in reply to Views on reinitializing Log4perl

Hello #perl_noob,

I do not think so, that reset() method is meant to be used the way you are using it.

From the package documentation of package Log::Log4perl;

################################################## sub reset { # Mainly for debugging/testing ################################################## # Delegate this to the logger ... return Log::Log4perl::Logger->reset(); }

Do you have a source of where you found someone applying this approach? Maybe I am wrong.

But why not to try something like that (log4Perl dynamic filename)? Would this approach resolve your problem?

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: Views on reinitializing Log4perl
by #perl_noob (Acolyte) on Apr 26, 2017 at 17:23 UTC

    My bad. I went through the source code of Log4perl and found that the Log4perl->init() delegates the initialization to Log4perl::Config->init() which uses reset() by default before going ahead with any initialization. So, no need to call reset() explicitly before init().
    Thank you for the input.