Wednesday, July 30, 2003 05:31 AM
If you use the
you will create a new logger for each class. This does not mean that you will create files for each class. If you configure only the rootlogger in the properties to log to a file, all classes will log to that file. But by using this technique you can change the output of one specific class later on. You can start by configurating log4j like this:
(Where consoleLog is a console appender). Later when you have a class you need to debug you can change the properties to:
# My error clas
No all INFO and up messages from all the other classes will go to the console, but all DEBUG messages (and up) from the class 'com.company.product.ClassName' will be send to the myFileLog appender.
For more information look at the website of log4j