2009-09-25 13:21:29 UTC
diff -u vacation.pl-orig vacation.pl
--- vacation.pl-orig 2009-09-25 14:18:16.000000000 +0100
+++ vacation.pl 2009-09-18 15:21:04.000000000 +0100
@@ -188,7 +188,7 @@
if($syslog == 1) {
my $syslog_appender = Log::Log4perl::Appender->new(
'Log::Dispatch::Syslog',
- Facility => 'user',
+ Facility => 'mail',
);
$logger->add_appender($syslog_appender);
}
@@ -259,6 +259,7 @@
my $int = $row[0];
if ($int > $interval) {
$logger->debug("[Interval elapsed, sending the message]: From: $from To:$to");
+ $logger->info("Notification interval elapsed, sending vacation reply: From: $from To:$to");
$query = qq{UPDATE vacation_notification SET notified_at=NOW() WHERE on_vacation=? AND notified=?};
$stm = $dbh->prepare($query);
if (!$stm) {
@@ -272,6 +273,7 @@
return 0;
} else {
$logger->debug("Notification interval not elapsed; not sending vacation reply (to: '$to', from: '$from')");
+ $logger->info("Already notified, not sending vacation reply (to: '$to', from: '$from')");
return 1;
}
} else {
@@ -374,6 +376,7 @@
}
$logger->debug("Will send vacation response for $orig_messageid: FROM: $email (orig_to: $orig_to), TO: $orig_from; VACATION SUBJECT: $row[0] ; VACATION BODY: $row[1]");
+ $logger->info("Sending vacation response (not previously notified) for $orig_messageid: FROM: $email (orig_to: $orig_to), TO: $orig_from");
my $subject = $row[0];
my $body = $row[1];
my $from = $email;
Not sure if that's the best format of logging, or if it should just be one log message in each place. I just wanted something in place quickly !