Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: log4perl help

by jcb (Parson)
on Mar 04, 2021 at 03:14 UTC ( [id://11129103] : note . print w/replies, xml ) Need Help??


in reply to Re^4: log4perl help
in thread log4perl help

While I am unfamiliar with Log4perl, I can guess that there is probably some action you must take to cause the output file to be reopened before a change to the output filename will be effective.

Is there some kind of "rotate logs" operation in Log4perl?

Replies are listed 'Best First'.
Re^6: log4perl help
by drohr (Acolyte) on Mar 04, 2021 at 18:57 UTC

    After alot of searching, I found this:

    http://log4perl.sourceforge.net/releases/Log-Log4perl/docs/html/Log/Log4perl/Appender/File.html

    So, for the next person who runs into this issue. This is how you change the file in an appender at run time:

    Log::Log4perl->appender_by_name('FILE')->file_switch('test2.log');