- Download the latest and the greatest from Log4J.
- Download the latest and the greatest from Apache Commons Logging.
- Add the libraries to the $CLASSPATH.
- Write a Log4J properties file called
log4j.properties
and place it in a directory in the $CLASSPATH. - You can now start logging in a class simply obtaining a logger with:
private static final Log log = LogFactory.getLog(YourClass.class);
- and using it:
log.info("your logging comment");
Thursday, March 22, 2007
Using Apache Commons Logging and Log4j
It's as easy as this:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment