From 3e28328dc9b064efc8a03000c82b4e05ac4148eb Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 18 Nov 2011 23:39:13 +1100 Subject: syslog() --- inc/display.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index 655aaf22..93afd59d 100644 --- a/inc/display.php +++ b/inc/display.php @@ -61,10 +61,15 @@ 'bottom' => '
' . $body . '
' ); } - - function error($message) { + + function error($message, $priority = true) { global $board, $mod, $config; + if($config['syslog'] && $priority !== false) { + // Use LOG_NOTICE instead of LOG_ERR or LOG_WARNING because most error message are not significant. + _syslog($priority !== true ? $priority : LOG_NOTICE, $message); + } + if(defined('STDIN')) { // Running from CLI die('Error: ' . $message . "\n"); -- cgit v1.3