How to programmatically determine when a rollover happened in log4j? -


i attempting use log4j write csv files. csv header must written top of log file every time created. example, of these rolled files must have following first line in log file:

log.0 timestamp, name, min, max

log.1 timestamp, name, min, max

log.2 timestamp, name, min, max

is possible determine when rollover has occurred can append header?

thanks.

p.s: know there lots of open source csv writers prefer not use them because use existing log functionality in our software.

if @ log4j documentation rollingfileappender, has method called rollover.

http://logging.apache.org/log4j/1.2/apidocs/index.html

you need implement custom file appender inherits rollingfileappender, , override rollover method. imagine call super.rollover, , write whatever want header new file before gets logged it.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -