The Torrus collector reopens STDERR upon SIGHUP:
Line 113 in source
my $rotateLogs = sub
{
Info('Caught SIGHUP. Reopening log file');
close( STDERR );
open( STDERR, ">>$logfile" );
$| = 1;
};
After assigning this signal handler, the collector spawns a child thread. The child prints its debugging and error messages to STDERR. The problem appeared that when the logfile is moved and SIGHUP is sent to the process, only the parent process starts to write to the new file. The child thread continues writing to the old file.
How can I organize the logging so that the file rotation is still possible? Would log4perl be of any help?
|