9

I have a commons-logging configuration question.

I want it to use SimpleLog (instead of java.util.logging) and log all messages with level >= debug (instead of info).

flybywire
  • 261,858
  • 191
  • 397
  • 503

1 Answers1

12

According to the commons-logging docs, you should be able to explicitly configure it to use SimpleLog by placing a commons-logging.properties file in the root of your classpath with the following entry:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

You can then configure SimpleLog itself by placing a simplelog.properties file in your classpath root containing this:

org.apache.commons.logging.simplelog.defaultlog=debug

However, I'd recommend against doing any of this. java.util.logging is nasty, but it's better than SimpleLog, and log4j is better than all of them.

skaffman
  • 398,947
  • 96
  • 818
  • 769
  • 1
    and logback is better then all of them ;). If came to this question via the context of cayenne, trying to stop it from outputing these annoying info messages to stderr (which seems to be the default to j.u.l). Anyways, thanks for the quick and to the point answer. – Maxim Veksler Nov 23 '10 at 17:00