My goal is to use java.util.logging(jdk1.6)
- write all logs to the same log file and
- do log rotation
- can use %u in file pattern to avoid potential file conflict with other program
I had configured a root logger and several named logger, where
root logger's handler set to java.util.logging.FileHandler
with settings
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern = xxx.%u.log
java.util.logging.FileHandler.limit = 200000
java.util.logging.FileHandler.count = 20
java.util.logging.FileHandler.append = true
and named loggers' handler set to customFileH
with customized settings
customFileH.class = java.util.logging.FileHandler
customFileH.level = ALL
customFileH.formatter = xxxFormat
When I run the program, the root logger will write log to xxx.0.log,
while named logger will write log to xxx.0.log.1, as different log files.
Even I took out "%u" in file pattern; remark file rotation configs, did them write to different log files. :(
Thanks for any comment in advance. :)