I use the Apache Commons Logging api with the log4j configuration file (the log4j configuration file is simple, easy for a beginner to understand, and has many examples to work with.
I prefer to use the community registration API because its agnostic about its configuration file. It can be configured through file formats for any number of popular logging packages.
Here is a simple log4j installation that will print out debugging information for your own packages, the INFO level for spring and sleep mode, and WARN for everything else:
# Global logging configuration log4j.rootLogger=WARN, stdout log4j.category.org.mydomain.org=DEBUG log4j.category.org.hibernate=INFO log4j.category.org.springframework=INFO # CONSOLE appender not used by default log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] %c - %m%n
Jherico
source share