From e2261e177bc9f5308185d91783ca128000c6fd87 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Apr 2013 20:34:20 +0400 Subject: [PATCH] implement old log entry purging in update_daemon_common; add some more error types; tweak error log display --- classes/logger.php | 5 +++++ include/rssfuncs.php | 14 ++++++++++++++ prefs.css | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/classes/logger.php b/classes/logger.php index e0ca37363..3c501eb92 100644 --- a/classes/logger.php +++ b/classes/logger.php @@ -4,7 +4,12 @@ class Logger { public static $errornames = array( 1 => 'E_ERROR', 2 => 'E_WARNING', + 4 => 'E_PARSE', 8 => 'E_NOTICE', + 16 => 'E_CORE_ERROR', + 32 => 'E_CORE_WARNING', + 64 => 'E_COMPILE_ERROR', + 128 => 'E_COMPILE_WARNING', 256 => 'E_USER_ERROR', 512 => 'E_USER_WARNING', 1024 => 'E_USER_NOTICE', diff --git a/include/rssfuncs.php b/include/rssfuncs.php index b3bf25849..0a20f5d8e 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -148,6 +148,7 @@ expire_cached_files($debug); expire_lock_files($debug); + expire_error_log($link, $debug); $nf = 0; @@ -1197,6 +1198,19 @@ return $doc->saveXML($node); } + function expire_error_log($link, $debug) { + if ($debug) _debug("Removing old error log entries..."); + + if (DB_TYPE == "pgsql") { + db_query($link, "DELETE FROM ttrss_error_log + WHERE created_at < NOW() - INTERVAL '7 days'"); + } else { + db_query($link, "DELETE FROM ttrss_error_log + WHERE created_at < DATE_SUB(NOW(), INTERVAL 7 DAY)"); + } + + } + function expire_lock_files($debug) { if ($debug) _debug("Removing old lock files..."); diff --git a/prefs.css b/prefs.css index dc527ca1e..254de4f34 100644 --- a/prefs.css +++ b/prefs.css @@ -131,5 +131,11 @@ table.prefErrorLog tr.errrow td { table.prefErrorLog tr.errrow td.errno { font-style : italic; + font-weight : bold; white-space : nowrap; } + +table.prefErrorLog td.filename, table.prefErrorLog td.login, table.prefErrorLog td.timestamp { + color : gray; +} +