From: <mat...@th...> - 2006-10-11 18:53:44
|
Hi, =20 I'm using log4perl and, at the end of my script, i want to zip up my logfile along with some other information (winxp, activestate 5.8.8.817). however, the log4perl logfile is empty in the .zip file. the problem is that the buffer isn't flushed by the time i call wzzip.exe to zip it up. is there a parameter with which to force a buffer flush? here's the relevant code: =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D use Log::Log4perl qw(get_logger :levels); =20 our $logger =3D get_logger(); $logger->level($INFO); my $appender =3D Log::Log4perl::Appender->new( "Log::Dispatch::File", filename =3D> "$pdir\\Logs\\${date}_${jobname}.log", mode =3D> "append", ); $logger->add_appender($appender); my $layout =3D Log::Log4perl::Layout::PatternLayout->new("%d %p> = %F{1}:%L %M - %m%n"); $appender->layout($layout); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D =20 |