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

Hi,

I am new and a perl newbie.

I use log4perl successfully.

Anyhow. I would like to change the filename for an appender at runtime.

I found the method (I guess it is called)

my $perli=Log::Log4perl->appender_by_name("av_std_LOGFILE");

It returns the ref to the appender object (if I am not wrong).
When debugging the script I can see the setting with "x $perli".
But now I am looking for the command to change the filename setting.
I would appreciate some help on this.

Thanks
Karl-Heinz

Replies are listed 'Best First'.
Re: log4perl change appender filename
by averlon (Sexton) on May 15, 2016 at 13:10 UTC
    found the solution somewhere deep in the docs myself:
    $perli->file_switch("test.log");
    Regards Karl-Heinz