Questions tagged [apache-commons-logging]

Apache Commons Logging is a logging facade for the Java programming language.

Apache Commons Logging is a component of the Apache Commons project. Apache Commons Logging is a logging facade, is open source software distributed under the Apache License, Version 2.0, and provides a common API for use with several logging implementations, including log4j and Java Logging.

This logging facade allows the logging implementation to be chosen at runtime yet allows all logging development to be done against a single API.

Related Tags

231 questions
108
votes
3 answers

What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don't use this property?

What is the significance of log4j.rootLogger property in log4j.properties file? What happens if I don't use this property? Example: # Set root logger level to DEBUG and its only appender to A1. log4j.rootLogger=DEBUG, A1 # A1 is set to be a…
Jitendra
  • 1,193
  • 2
  • 8
  • 7
71
votes
4 answers

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

I am using Apache Commons Logging ™. For now I wanted to use SimpleLog implementation, but when I changed the level, loggers from the libraries came out. I want it to turn them off. Is there a easy way to change log level for whole package (can…
Damian
  • 2,930
  • 6
  • 39
  • 61
64
votes
4 answers

How do I set up commons-logging to use logback?

We use slf4j + logback, and happened to have some third-party libraries which use commons-logging. How do I set it up to use logback?
Artem
  • 7,275
  • 15
  • 57
  • 97
48
votes
8 answers

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

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,…
Thilo
  • 257,207
  • 101
  • 511
  • 656
47
votes
4 answers

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

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?…
Ta Sas
  • 9,573
  • 15
  • 51
  • 73
39
votes
3 answers

Difference between Simple Logging Facade for Java and Apache Commons Logging

What is the difference between Simple Logging Facade for Java and Apache Commons Logging?
Azder
  • 4,698
  • 7
  • 37
  • 57
33
votes
9 answers

Turning on Logging in HttpClient

How do you properly turn on Logging for Apache Commons HttpClient Right now I am doing this and getting no log messages except the one I triggered explicitly as a test: public class HttpTest1 { static Log log =…
32
votes
8 answers

Maven build [WARNING] we have a duplicate class

Anybody has any idea what happened to my maven build? I am getting a lot of duplicate warnings. [WARNING] We have a duplicate org/apache/commons/logging/impl/LogFactoryImpl$1.class in…
Shengjie
  • 12,336
  • 29
  • 98
  • 139
25
votes
4 answers

Adjust Logging level for apache commons logging?

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…
user364902
  • 3,146
  • 6
  • 23
  • 23
25
votes
3 answers

How to disable Spring logging DEBUG messages?

I'm working on a simple desktop app (not webapp). Here is my log4j.properties: log4j.rootCategory=INFO,…
rapt
  • 11,810
  • 35
  • 103
  • 145
23
votes
6 answers

Is it worth wrapping a logging framework in an additional layer?

I'm currently looking at upgrading the logging mechanism in a medium-to-large-sized Java codebase. Messages are currently logged using static methods on a Debug class, and I have recommended switching from this to something like SLF4J or…
harto
  • 89,823
  • 9
  • 47
  • 61
16
votes
3 answers

How to use log4j 2.0 and slf4j and Commons Logging together

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…
raudi
  • 1,701
  • 1
  • 16
  • 16
15
votes
2 answers

Write log file using org.apache.commons.logging

I'm writing an application where I need to write log to a file using org.apache.commons.logging library, but i don't know how to start. Can anyone help me? Thanks & best regards.
KhanhQuach
  • 153
  • 1
  • 1
  • 7
14
votes
2 answers

Spring Maven project commons-logging LogFactory NoClassDefFoundError

I have a Maven project that uses Spring to run a json web service. The project runs fine in NetBeans. It gets compiled into a jar file, and the jar file runs fine in an Ubuntu VM. However, when I try to run the jar file in Windows, I get the…
Mark Nugent
  • 599
  • 2
  • 5
  • 20
13
votes
7 answers

Commons Logging priority best practices

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…
smp7d
  • 4,947
  • 2
  • 26
  • 48
1
2 3
15 16