logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Re: File Appender in log4j
Date Wed, 22 Nov 2006 00:24:53 GMT

On Nov 21, 2006, at 4:21 PM, ying lcs wrote:

> Hi,
> Can you please tell me how can I configure file appender so that it
> writes to 1 log file per data and have the old one stays?
> Thank you.

I guessing that you meant "1 log file per DAY".  If that is your  
request, you could use a DailyRollingFileAppender which would write  
all log messages to a file which would be renamed after the day  
changes.   The configuration would looks something like:

log4j.rootLogger=DEBUG, drfa

Messages would be logged to mylog.log and after the day changes the  
file would be close, renamed mylog.log.2006-11-21 and subsequent  
logging would be captured in a new mylog.log file.

There has been some development of a MultiFileAppender that could  
actually write the file in place and would not require renaming the  
file, but that isn't working yet.

To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

View raw message