my $logger = Guardian::Logger->New(%mainsettings);
$logger->Log("debug", "Logger successfully initialized...");
+# Redirect perls "die" messages to the logger before exiting.
+$SIG{__DIE__} = sub { $logger->Log("err", "@_"); };
+
# Shared hash between the main process and all threads. It will store all
# monitored files and their current file position.
my %monitored_files :shared = ();