shree has asked for the wisdom of the Perl Monks concerning the following question:
Hi I have my log4 Perl configuration file as below, Here I have done the changes to conf file to create the new log file every day midnight 12:00 automatically. But still it's writing to the same existing file even after the date get change, instead of creating the new log file with current date.
Here all my Perl scripts which creates the logs are running in daemon mode and it runs 24*7. Here I have the Log::Dispatch::FileRotate with Version 1.19
Can anyone help me on this?[log4perl] log4perl.logger=WARN,Logfile log4perl.appender.Logfile = Log::Dispatch::FileRotate log4perl.appender.Logfile.filename = sub { return get_log(); } log4perl.appender.Logfile.mode = append log4perl.appender.Logfile.max = 2 log4perl.appender.Logfile.DatePattern = yyyy-MM-dd log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayou +t log4perl.appender.Logfile.layout.ConversionPattern = %d %p> %m%n log4perl.appender.Screen = Log::Log4perl::Appender::Screen log4perl.appender.Screen.stderr = 0 log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Screen.layout.ConversionPattern = %d %p> %m%n [Modules level setup]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I roll over my log files automatically at midnight with Log4 Perl?
by happy.barney (Friar) on Nov 29, 2010 at 09:29 UTC | |
|
Re: How can I roll over my log files automatically at midnight with Log4 Perl?
by chrestomanci (Priest) on Nov 29, 2010 at 09:38 UTC |