Open XSven opened 2 years ago
Can you capture this in a bit of test code?
These 2 ok() test assertions should pass. Unfortunately the second one is failing.
#########################################################
# Testing create_at_logtime with file_switch()
#########################################################
unlink "${testfile}_6"; # delete leftovers from previous tests
$data = qq(
log4perl.category = DEBUG, Logfile
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.filename = ${testfile}_6
log4perl.appender.Logfile.create_at_logtime = 1
log4perl.appender.Logfile.layout = Log::Log4perl::Layout::SimpleLayout
);
Log::Log4perl->init(\$data);
ok(! -f "${testfile}_6");
$app = Log::Log4perl->appenders()->{Logfile};
$app->file_switch("${testfile}_7");
ok(! -f "${testfile}_7");
unlink "${testfile}_6", "${testfile}_7";
Log-Log4perl-1.54
Switching the log file name using the
file_switch()
method, creates a new logfile even if thecreate_at_logtime
option is set to true. Maybe the line 271 inLog::Log4perl::Appender::File
should be changed from$self->file_open();
to
$self->file_open() unless $self->{create_at_logtime};