mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 01:05:56 +00:00
make logging configurable; add logging to syslog
This commit is contained in:
@@ -1,22 +1,12 @@
|
||||
<?php
|
||||
// TODO: make configurable
|
||||
require_once "classes/logger.php";
|
||||
require_once "classes/logger/sql.php";
|
||||
|
||||
function ttrss_error_handler($errno, $errstr, $file, $line, $context) {
|
||||
global $logger;
|
||||
|
||||
if (error_reporting() == 0 || !$errno) return false;
|
||||
|
||||
if (!$logger) $logger = new Logger_SQL();
|
||||
|
||||
$file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);
|
||||
|
||||
if ($logger) {
|
||||
return $logger->log_error($errno, $errstr, $file, $line, $context);
|
||||
}
|
||||
|
||||
return false;
|
||||
return Logger::get()->log_error($errno, $errstr, $file, $line, $context);
|
||||
}
|
||||
|
||||
function ttrss_fatal_handler() {
|
||||
@@ -36,14 +26,7 @@ function ttrss_fatal_handler() {
|
||||
|
||||
$file = substr(str_replace(dirname(dirname(__FILE__)), "", $file), 1);
|
||||
|
||||
if (!$logger) $logger = new Logger_SQL();
|
||||
|
||||
if ($logger) {
|
||||
if ($logger->log_error($errno, $errstr, $file, $line, $context)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return Logger::get()->log_error($errno, $errstr, $file, $line, $context);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user