Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 347
flybywire Avatar asked Feb 04 '23 09:02

flybywire


1 Answers

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.

like image 151
skaffman Avatar answered Feb 06 '23 16:02

skaffman