DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Jakub is a Java EE developer since 2005 and occasionally a project manager, working currently with Iterate AS. He's highly interested in developer productivity (and tools like Maven and AOP/AspectJ), web frameworks, Java portals, testing and performance and works a lot with IBM technologies. A native to Czech Republic, he lives now in Oslo, Norway. Jakub is a DZone MVB and is not an employee of DZone and has posted 156 posts at DZone. You can read more from them at their website. View Full User Profile

Commons-logging - SimpleLog Configuration

04.23.2010
| 6691 views |
  • submit to reddit
        Configure commons-logging to use the SimpleLog implementation that it includes and configure the SimpleLog. Useful e.g. for running unit tests.

commons-logging.properties:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog

simplelog.properties:
## SimpleLog instance settings.
org.apache.commons.logging.simplelog.defaultlog=debug
org.apache.commons.logging.simplelog.showlogname=true
org.apache.commons.logging.simplelog.showdatetime=true
org.apache.commons.logging.simplelog.dateTimeFormat=HH:mm:ss:SSS zzz yyyy/MM/dd

## Configure logging levels
#org.apache.commons.logging.simplelog.log.org.exolab.castor=INFO
#org.apache.commons.logging.simplelog.log.org.jmock=DEBUG