I am writing a Tomcat application that uses log4j. I want to create several logs to several differant files. I tried creating several loggers with differant names and these loggers used differant conifiguration property files but when I change the settings for one logger it changes it for all the logggers.
Joined: Nov 24, 2000
Assuming you want to create different log files for code in different Java packages, this is fairly easy. You only need one log4j configuration file.
Here is an example that should get you started. Watch what is commented out, this is a cut and paste of current config.
Guy [ November 17, 2007: Message edited by: Guy Allard ]
Joined: Apr 11, 2005
I tried this but not working I simply run a java application in a loop which is calling x.java and y.java, want to create log for x.log and y.log calling both the classes from XY.java main method, logs are mixing up I am using DOMConfigurator static block.