Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Log::Log4perl and Log::Dispatch::FileRotate: Issues rotating log files based on date pattern (rotate log every day)

by Anonymous Monk
on Jan 27, 2015 at 00:53 UTC ( [id://1114584]=note: print w/replies, xml ) Need Help??


in reply to [SOLVED] Log::Log4perl and Log::Dispatch::FileRotate: Issues rotating log files based on date pattern

The easiest way to rotate the log every day is to use Re: log4Perl dynamic filename its FAQ
log4perl.appender.Logfile.filename = sub { my $date = POSIX::strftime('%Y-%m-%d', localtime ); return "myapp-$date.log"; };
  • Comment on Re: Log::Log4perl and Log::Dispatch::FileRotate: Issues rotating log files based on date pattern (rotate log every day)
  • Download Code

Replies are listed 'Best First'.
Re^2: Log::Log4perl and Log::Dispatch::FileRotate: Issues rotating log files based on date pattern (rotate log every day)
by ateague (Monk) on Jan 30, 2015 at 17:54 UTC

    Thanks.

    That certainly will create new log files every day but, the downside to that approach is that it will not *rotate* the log files after a certain number of days (8 in my case)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1114584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found