ravi45722 has asked for the wisdom of the Perl Monks concerning the following question:

log4perl.rootLogger=DEBUG, LOGFILE log4perl.appender.LOGFILE=Log::Log4perl::Appender::File log4perl.appender.LOGFILE.filename=/home/GEMS/ravi/Node/logs/Script.lo +g log4perl.appender.LOGFILE.mode=append log4perl.appender.LOGFILE.layout=PatternLayout log4perl.appender.LOGFILE.layout.ConversionPattern=%d : %r : %c - %m%n

This is my config for the logger

I seen

 Log::Dispatch::FileRotate

to rotate the file. I need to rotate the file based on the date. (Every day one single file). But how to add this to my conf??

In my conf pattern %d prints 2017/03/26 12:17:33 can I change this pattern to 2017-03-26 12:17:33.432

Replies are listed 'Best First'.
Re: Log::Log4perl help in rotating file
by vr (Curate) on Mar 26, 2017 at 11:44 UTC
    to rotate the file

    FWIW,

    log4perl.appender.File = Log::Dispatch::File::Stamped

    just works with default settings, add a line like this and forget.

Re: Log::Log4perl help in rotating file
by beech (Parson) on Mar 26, 2017 at 08:47 UTC