apache-commons-logging

Difference between Simple Logging Facade for Java and Apache Commons Logging

牧云@^-^@ 提交于 2019-12-20 08:57:14
问题 What is the difference between Simple Logging Facade for Java and Apache Commons Logging? 回答1: From the SLF4J FAQ: SLF4J is conceptually very similar to JCL. As such, it can be thought of as yet another logging facade. However, SLF4J is much simpler in design and arguably more robust. In a nutshell, SLF4J avoid the class loader issues that plague JCL. Do a google for "JCL classloader issues" for more on this... 回答2: While SLF4J can be used as a facade over libraries like Log4j, or JUL, it can

Adjust Logging level for apache commons logging?

你。 提交于 2019-12-18 02:23:08
问题 I have a simple console app which uses apache's PDFBox library, which in turn uses commons logging. I'm getting a lot of junk messages in my console which I'd like to suppress: Feb 15, 2011 3:56:40 PM org.apache.pdfbox.util.PDFStreamEngine processOperator INFO: unsupported/disabled operation: EI In my code, I've tried to reset the log levels to no avail: Logger.getLogger("org.apache.pdfbox.util.PDFStreamEngine").setLevel(Level.OFF); Logger.getLogger("org.apache.pdfbox.util").setLevel(Level

What is the issue with the runtime discovery algorithm of Apache Commons Logging

痞子三分冷 提交于 2019-12-17 10:15:01
问题 Dave Syer (SpringSource) writes in his blog: Unfortunately, the worst thing about commons-logging, and what has made it unpopular with new tools, is also the runtime discovery algorithm. Why? What is the issue with its runtime discovery algorithm? Performance? 回答1: Why? What is the issue with its runtime discovery algorithm? Performance? No, it's not performance, it's classloader pain. JCL discovery process relies on classloader hacks to find the logging framework at runtime but this

How to disable loggers of a class or of whole package?

南楼画角 提交于 2019-12-17 07:17:32
问题 I am using apache.commons.logging, for now I wanted to use SimpleLog implementation, but when changed the level, loggers from libraries come out. I want it to turn it off. Is there a easy way to change log level for whole package (Can log4j do that) ? I have tried to set org.apache.commons.logging.simplelog.log.foo=fatal in simplelog property files to disable (setting to fatal is OK) foo logger, but it doesn't works. (foo is a name of logger that appears in output : [INFO] foo - Message). 回答1

Log4j is implementation of commons-logging or slf4j?

一个人想着一个人 提交于 2019-12-13 08:24:50
问题 Hy, I have read that commons-logging and slf4j are "interfaces or specifications" for logging and you have to plugin an implementation. But I have read that you can use log4j for example with commons-logging and with slf4j too, so: log4j "implements" the specifications of commons-logging and slf4j at the same time? I dont understand it Thanks 回答1: SLF4j is a logging facade and can be introduced into both Log4j and commons-logging projects. So you use SLF4j classes to perform the logging it

log4j type GenericObjectPool does not take parameters

强颜欢笑 提交于 2019-12-12 13:40:26
问题 I am trying to configure log4j for logging to database using JDBCAppender by referring to the below link. http://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCAppender However I am getting the error "type GenericObjectPool does not take parameters". could some one please help me rectify this error? log4j2.xml <?xml version="1.0" encoding="UTF-8"?> <Configuration status="error"> <Appenders> <JDBC name="databaseAppender" tableName="LOGGING.APPLICATION_LOG"> <ConnectionFactory class=

Issues with Apache HTTP Client and logging

末鹿安然 提交于 2019-12-11 12:06:14
问题 In my Tapestry application, I need to do a GET request to a certain URL at some point. I do it like this (using Apache's HttpClient 4.2.1) String scheme = getScheme(); String host = getHost(); int port = getPort(); String path = getPath(); String paramKey = getParamKey(); String paramValue = getParamValue(); URIBuilder builder = new URIBuilder(); builder .setScheme(scheme) .setHost(host) .setPort(port) .setPath(path) .setParameter(paramKey, paramValue); URI uri = builder.build(); HttpGet

Logging from Spring using Log4j under WebSphere

偶尔善良 提交于 2019-12-11 05:05:28
问题 I'm using log4j in my WebSphere application. I need to debug class org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor , so I've created logger in my log4j.xml file: <logger name="org.springframework"> <level value="INFO" /> </logger> <logger name="org.springframework.ejb.access"> <level value="TRACE" /> </logger> I've created also commons-logging.properties in src/main/resources of the web project (in maven): org.apache.commons.logging.Log=org.apache.commons.logging.impl

Websphere Application Debug logging

孤人 提交于 2019-12-11 02:06:03
问题 I am trying to get my web application deployed on Websphere 6.1 to display debug level logs. Originally I was using log4j, but have changed all loggers to use commons logging since it seems this is supported by Websphere. I have set the log level under Logging and Tracing > server1 > Change Log Detail Levels to: *=info: com.myapplication.*=all Unfortunately this only seems to display info level logs from my application in the SystemOut.log The following shows up in the logs: if (log

What is Logging, and how is Apache Commons logging used?

喜你入骨 提交于 2019-12-10 18:49:04
问题 What information would a web application server wish to log, and why? From what I understand org.apache.commons.logging.Log is an interface that abstracts the functionality provided by other Logging classes, and the same applies to the interface LogFactory. Code I am trying to understand has - Log auditLogger = LogFactory.getLog(someString); How is the String someString used to identify what LogFactory to generate? How can I see the implementation of the Log and LogFactory classes being used?