logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ying lcs" <ying...@gmail.com>
Subject Re: File Appender in log4j
Date Thu, 30 Nov 2006 04:11:37 GMT
I try it, but I get this error "

log4j:WARN No such property [maxBackupIndex] in
org.apache.log4j.DailyRollingFileAppender.

I put this line in the log4j properties file.
log4j.appender.ACCESS.MaxBackupIndex=7


On 11/28/06, Shuh Chang <shuh.chang@gemalto.com> wrote:
> I think you can set the MaxBackupIndex parameter like this:
>
> log4j.appender.drfa.MaxBackupIndex=7
>
>
> -----Original Message-----
> From: ying lcs [mailto:yinglcs@gmail.com]
> Sent: Monday, November 27, 2006 10:42 PM
> To: Log4J Users List
> Subject: Re: File Appender in log4j
>
>
> Thanks for the advice.
>
> Can you please tell me how can i only keep the last 7 days of the log ?
>
> Thank you.
>
>
> On 11/21/06, Curt Arnold <carnold@apache.org> wrote:
> >
> > 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
> > log4j.appender.drfa=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.drfa.file=mylog.log
> > log4j.appender.drfa.Append=false
> > log4j.appender.drfa.layout=org.apache.log4j.PatternLayout
> > log4j.appender.drfa.layout.ConversionPattern=%m\n
> >
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

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


Mime
View raw message