I am placing a logging.properties in the WEB-INF/classes dir of tomcat
I would like to log to two different files. For example: org.pkg1 goes to one file and org.pkg
Speaking of logging.properties configuration, I did not found any mechanism to use more that one appender. I made simple workaround that works for me.
public class CustomAFileHandler extends FileHandler {
public DebugFileHandler() throws IOException, SecurityException {
super();
}
}
public class CustomBFileHandler extends FileHandler {
public DebugFileHandler() throws IOException, SecurityException {
super();
}
}
And my logging.properties
...
handlers=.CustomAFileHandler, .CustomBFileHandler, java.util.logging.ConsoleHandler
.CustomAFileHandler.level=ALL
.CustomAFileHandler.pattern=%h/A%u.log
.CustomAFileHandler.limit=50000
.CustomAFileHandler.count=1
.CustomAFileHandler.formatter=java.util.logging.SimpleFormatter
.CustomBFileHandler.level=ALL
.CustomBFileHandler.pattern=%h/B%u.log
.CustomBFileHandler.limit=50000
.CustomBFileHandler.count=1
.CustomBFileHandler.formatter=java.util.logging.SimpleFormatter
...