From f4b6bde3c214aff4b7db2d56c5a6de7102eddbe2 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 30 Apr 2018 13:02:43 -0400 Subject: [PATCH] Put print to STDERR before logging to db because it is more reliable than db --- scripts/ZoneMinder/lib/ZoneMinder/Logger.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm index 30cbc11a6..929a32b2e 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm +++ b/scripts/ZoneMinder/lib/ZoneMinder/Logger.pm @@ -583,6 +583,8 @@ sub logPrint { syslog($priorities{$level}, $code.' [%s]', $string); } print($LOGFILE $message) if $level <= $this->{fileLevel}; + print(STDERR $message) if $level <= $this->{termLevel}; + if ( $level <= $this->{databaseLevel} ) { if ( ( $this->{dbh} and $this->{dbh}->ping() ) or ( $this->{dbh} = zmDbConnect() ) ) { @@ -609,7 +611,6 @@ sub logPrint { print(STDERR "Can't log to database: "); } } # end if doing db logging - print(STDERR $message) if $level <= $this->{termLevel}; } # end if level < effectivelevel }