I am currently using the DailyRollingFileAppender class in log4j to add a log file daily, but I want the log files to be split in the following format:
DATA.log.<date>_<time>_<random_#>
This has to be done once to run the program, so I get something like ...
DATA.log.2011-01-13_12-46-38_<26> DATA.log.2011-01-13_12-46-38_<79> DATA.log.2011-01-13_12-46-38_<590>
If different log files from different environments can be combined together.
Is there a way to do this without extending the FileAppender class? At least there is a way to do:
DATA.log.<date>_<time>_<sequential_#>.log
thanks
Edit: I am already using DailyRollingFileAppender to get something like DATA.log.2011-01-13. I want to know how to do this: get the log file for rollover after each program (or before each program) and add a random number line at the end.
java logging config log4j
Kevin
source share