Hello,

I have a question on file appenders, particularly RollingFileAppender. I
would like to know how to make an instance of RollingFileAppender "rollover"
during Log4j initialization. By "rollover", I mean that the previously
existing log file (such as server.log) and the backup files (such as
server.log.1, server.log.2, ... server.log.[maxBackupIndex-1]) are renamed
to server.log.1, server.log.2, server.log.3, ... server.log.[maxBackupIndex]
and a new log file (server.log) is created when the log4j environment is
configured at the time of initialization.

I want to know if there is a general way to configure the Log4j environment
to roll over all files at the time of Log4j initialization. And then, is
there a way to configure each appender differently so that some file
appenders roll over files during Log4j initialization, while others do not?

If not through configuration files, what is the best way to achieve this
programmatically?

Regards,
Tarun Bhatia

-- 
Drishti-Soft Solutions Pvt Ltd
SCO-36, Sector 31
Gurgaon, INDIA-122001

Reply via email to