Automatic reloading of changed configuration files:
To alleviate this performance hit a bit, init_and_watch() can be configured to listen for a Unix signal to reload the configuration instead:
Log::Log4perl->init_and_watch($conf_file, 'HUP');
This will set up a signal handler for SIGHUP and reload the configuration if the application receives this signal, e.g. via the kill command:
kill -HUP pid
where pid is the process ID of the application.
Log::Log4perl::Config::Watch:
SIGNAL MODE
Instead of polling time and file changes, new() can be instructed to set up a signal handler. If you call the constructor like
my $watcher = Log::Log4perl::Config::Watch->new(
file => "/data/my.conf",
signal => 'HUP'
);
then a signal handler will be installed, setting the object's variable $self->{signal_caught} to a true value when the signal arrives. Comes with all the problems that signal handlers go along with.
--
No matter how great and destructive your problems may seem now, remember, you've probably only seen the tip of them. [1]
| [reply] [d/l] [select] |