flybywire
flybywire

Reputation: 274072

commons-logging config: use SimpleLog & set debug level

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).

Upvotes: 9

Views: 10485

Answers (1)

skaffman
skaffman

Reputation: 403591

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.

Upvotes: 12

Related Questions