apache-commons-logging

How to use log4j 2.0 and slf4j and Commons Logging together

无人久伴 提交于 2019-12-03 03:06:34
I currently am starting a new Webapp (running on tomcat 6) I have components using slf4j and components using commons logging I plan to use log4j 2.0 as log implementation due to several reasons (mainly for the appenders:SocketAppender and SyslogAppender but also because of the promoted config reloading without loss of log events) Now my questions are: - To which interface do I program my new classes? loag4j or slf4j? or even commons logging? What's the preferred way to deploy the jars? put them in my application war or do i put them into the tomcat libs? what jars do I need to deploy? log4j

Commons Logging priority best practices

…衆ロ難τιáo~ 提交于 2019-12-03 02:22:44
This may be a purely subjective question (if no organization has attempted to standardize this), but my team struggles with this more than you would think. We use Apache Commons Logging as our logging interface and often the use of priority is not consistent across our development team. For example, some developers log any caught exception to fatal (log.fatal(message)) even though the flow is able to handle the error whereas others only log to fatal when something cause the program to necessarily cease execution for whatever reason. I would like to know how other teams define each priority.

Difference between Simple Logging Facade for Java and Apache Commons Logging

假装没事ソ 提交于 2019-12-02 17:30:29
What is the difference between Simple Logging Facade for Java and Apache Commons Logging ? 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... While SLF4J can be used as a facade over libraries like Log4j, or JUL, it can also be used as an API to implement native logging libraries, like Logback did. A native SLF4J library won't

Custom plugin not getting detected in EAR with log4j2 API

最后都变了- 提交于 2019-12-02 06:48:46
问题 I am migrating an EAR application from log4j to log4j2 . I had classes extending appenders, filters, layouts in different jars of EAR and now, I have converted those to plugins. This means I have custom plugins in more than one jar (assume 3 jars). I am not using packages attribute in log4j2.xml and am initializing the logging system by using Dlog4j.configurationFile JVM argument pointing to log4j2.xml location in META-INF of EAR. Adding the below plugin in all the three jar projects did not

Custom plugin not getting detected in EAR with log4j2 API

不想你离开。 提交于 2019-12-02 05:26:07
I am migrating an EAR application from log4j to log4j2 . I had classes extending appenders, filters, layouts in different jars of EAR and now, I have converted those to plugins. This means I have custom plugins in more than one jar (assume 3 jars). I am not using packages attribute in log4j2.xml and am initializing the logging system by using Dlog4j.configurationFile JVM argument pointing to log4j2.xml location in META-INF of EAR. Adding the below plugin in all the three jar projects did not work . <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin<

can't enable logging of spring framework

China☆狼群 提交于 2019-12-02 03:29:48
I want to configure the logging in Spring framework and Spring Security, and followed this http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/overview.html#overview-not-using-commons-logging but when I load the Tomcat I got this problem: GRAVE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/RH-Explore]] at java.util.concurrent.FutureTask.report(Unknown Source) at java.util.concurrent.FutureTask.get(Unknown

Nlog giving exception Possible explanation is lack of zero arg and single arg Common.Logging.Configuration.NameValueCollection constructors

时光毁灭记忆、已成空白 提交于 2019-12-01 20:03:56
I added nlog to my application and the test project for it. Both of them part of the same solution. From inside application nlog works. But from test project get below exception: Unable to create instance of type Common.Logging.NLog.NLogLoggerFactoryAdapter. Possible explanation is lack of zero arg and single arg Common.Logging.Configuration.NameValueCollection constructors My Nlog configuration is below: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />

How to exclude commons logging dependency of spring with ivy?

北慕城南 提交于 2019-11-30 02:35:52
问题 I have a project build with ant using ivy for dependency management. I have no ivysetting file, but an ivy.xml with the following dependency (I want to use spring with slf4j instead of commons logging): <configurations> <conf name="compile" /> <conf name="runtime" extends="compile"/> </configurations> <dependencies> <dependency org="org.springframework" name="spring-webmvc" rev="3.0.5.RELEASE" conf="compile->default"> <exclude org="commons-logging" name="commons-logging"/> </dependency>

Adjust Logging level for apache commons logging?

让人想犯罪 __ 提交于 2019-11-28 23:12:18
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.OFF); Logger.getLogger("org.apache.pdfbox").setLevel(Level.OFF); Despite these settings, the messages are

Java Logging: show the source line number of the caller (not the logging helper method)

大城市里の小女人 提交于 2019-11-28 04:51:36
The numerous (sigh...) logging frameworks for Java all do a nice job of showing the line number of the source file name for the method that created the log message: log.info("hey"); [INFO] [Foo:413] hey But if have a helper method in between, the actual caller will be the helper method, and that is not too informative. log_info("hey"); [INFO] [LoggingSupport:123] hey Is there a way to tell the logging system to remove one frame from the callstack when figuring out the source location to print? I suppose that this is implementation specific; what I need is Log4J via Commons Logging, but I am