]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
recover gracefully from syslog failures
[git.ikiwiki.info.git] / IkiWiki.pm
index 75c95793218384bd034914d574e63464f739fd31..2c0b1153c906c7a3fb33d0d575cfca1d87787946 100644 (file)
@@ -515,9 +515,8 @@ sub getsetup () {
        },
        cookiejar => {
                type => "string",
-               default => "$ENV{HOME}/.ikiwiki/cookies",
+               default => { file => "$ENV{HOME}/.ikiwiki/cookies" },
                description => "cookie control",
-               example => { file => "$ENV{HOME}/.ikiwiki/cookies" },
                safe => 0, # hooks into perl module internals
                rebuild => 0,
        },
@@ -729,6 +728,7 @@ sub debug ($) {
 }
 
 my $log_open=0;
+my $log_failed=0;
 sub log_message ($$) {
        my $type=shift;
 
@@ -739,9 +739,15 @@ sub log_message ($$) {
                        Sys::Syslog::openlog('ikiwiki', '', 'user');
                        $log_open=1;
                }
-               return eval {
+               eval {
                        Sys::Syslog::syslog($type, "[$config{wikiname}] %s", join(" ", @_));
                };
+                if ($@) {
+                    print STDERR "failed to syslog: $@" unless $log_failed;
+                    $log_failed=1;
+                    print STDERR "@_\n";
+                }
+                return $@;
        }
        elsif (! $config{cgi}) {
                return print "@_\n";