You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Bajjuri, Naveen" <na...@etrade.com> on 2002/09/05 20:10:01 UTC

dailyrollingfileappender cannot rollover when application is not running.

Hi,
	I have a question regarding log4j properties.I want my log file to
roll every day.
	I am trying to use DailyRollingFileAppender.

	
log4j.appender.FileAppender=org.apache.log4j.DailyRollingFileAppender
	log4j.appender.FileAppender.File=./logs/client-log.txt
	log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout
	log4j.appender.FileAppender.layout.ConversionPattern=%c-%p,
%d{DATE}, %t-%C{3} -- %m%n
	log4j.appender.FileAppender.DatePattern='.'yyyy-MM-dd

	Actually this appender with these parameters tries to roll at
midnight.So if the application using log4j is not running at midnight it
wont rollover.

	Can anyone help me?

	Is there any other way of making the log file roll every day..

	Thx
	Naveen Bajjuri


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: dailyrollingfileappender cannot rollover when application is not running.

Posted by RaYaKu <ya...@nous.soft.net>.
is it? For testing, Kindly change your system date and restart your
webcontainer,
I'm sure it would create a new one, It worked for me.

<rayaku/>


-----Original Message-----
From: Bajjuri, Naveen [mailto:naveen.bajjuri@etrade.com]
Sent: Thursday, September 05, 2002 11:40 PM
To: 'log4j-user@jakarta.apache.org'
Subject: dailyrollingfileappender cannot rollover when application is
not running.


Hi,
	I have a question regarding log4j properties.I want my log file to
roll every day.
	I am trying to use DailyRollingFileAppender.


log4j.appender.FileAppender=org.apache.log4j.DailyRollingFileAppender
	log4j.appender.FileAppender.File=./logs/client-log.txt
	log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout
	log4j.appender.FileAppender.layout.ConversionPattern=%c-%p,
%d{DATE}, %t-%C{3} -- %m%n
	log4j.appender.FileAppender.DatePattern='.'yyyy-MM-dd

	Actually this appender with these parameters tries to roll at
midnight.So if the application using log4j is not running at midnight it
wont rollover.

	Can anyone help me?

	Is there any other way of making the log file roll every day..

	Thx
	Naveen Bajjuri


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: dailyrollingfileappender cannot rollover when application is not running.

Posted by sk k <sk...@yahoo.com>.
If your application doesn't run at midnight, then when
it startups the next day, log4j will check if there is
any file with previous date(for u'r case) and roll it
over. Any new messages will go to the new file.

I tested it with minutes extension and it worked as
mentioned above.

But if doesn't work, let us know.


Also, u'r log file location starts with a dot(
./logs/client-log.txt ). Does it work?  I guess, u
where trying to specify above directory level ie (..)






--- "Bajjuri, Naveen" <na...@etrade.com>
wrote:
> Hi,
> 	I have a question regarding log4j properties.I want
> my log file to
> roll every day.
> 	I am trying to use DailyRollingFileAppender.
> 
> 	
>
log4j.appender.FileAppender=org.apache.log4j.DailyRollingFileAppender
> 
>
log4j.appender.FileAppender.File=./logs/client-log.txt
> 
>
log4j.appender.FileAppender.layout=org.apache.log4j.PatternLayout
> 
>
log4j.appender.FileAppender.layout.ConversionPattern=%c-%p,
> %d{DATE}, %t-%C{3} -- %m%n
> 
>
log4j.appender.FileAppender.DatePattern='.'yyyy-MM-dd
> 
> 	Actually this appender with these parameters tries
> to roll at
> midnight.So if the application using log4j is not
> running at midnight it
> wont rollover.
> 
> 	Can anyone help me?
> 
> 	Is there any other way of making the log file roll
> every day..
> 
> 	Thx
> 	Naveen Bajjuri
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>