Commit dc186a753067dca1ff80fe9a3b7d0a0d31172eeb
1 parent
18102958
KTS-2906
"Introduce logging of PEAR_Error into log file" Updated. Made this feature optional. Committed By: Conrad Vermeulen Reviewed By: Megan Watson git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8021 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
16 additions
and
3 deletions
thirdparty/pear/PEAR.php
| @@ -867,14 +867,27 @@ class PEAR_Error | @@ -867,14 +867,27 @@ class PEAR_Error | ||
| 867 | static $hasError=false; | 867 | static $hasError=false; |
| 868 | if (!$hasError) | 868 | if (!$hasError) |
| 869 | { | 869 | { |
| 870 | + if ($this instanceof KTEntityNoObjects) return; | ||
| 870 | $hasError = true; | 871 | $hasError = true; |
| 872 | + $config = KTConfig::getSingleton(); | ||
| 873 | + $logPearError = $config->get('tweaks/logPearError', false); | ||
| 874 | + if ($logPearError !== true) return; | ||
| 871 | 875 | ||
| 872 | global $default; | 876 | global $default; |
| 873 | - $trace = debug_backtrace(); | ||
| 874 | $msg = $this->getMessage(); | 877 | $msg = $this->getMessage(); |
| 875 | - if ($msg == 'No licenses have been installed') return; | 878 | + $ignore = array( |
| 879 | + _kt('No licenses have been installed'), | ||
| 880 | + _kt('Session timed out'), | ||
| 881 | + _kt('You need to login to access this page'), | ||
| 882 | + _kt('You are coming from a different IP address than the session requires'), | ||
| 883 | + _kt('Anonymous logins are no longer allowed by the system administrator. Please login.'), | ||
| 884 | + _kt('Your account has been disabled. Please contact the system administrator for assistance.')); | ||
| 885 | + | ||
| 886 | + if (in_array($msg, $ignore)) return; | ||
| 887 | + $trace = debug_backtrace(); | ||
| 888 | + | ||
| 876 | $default->log->info('PEAR_ERROR: ' . $msg); | 889 | $default->log->info('PEAR_ERROR: ' . $msg); |
| 877 | - $default->log->info('Stack Trace: ' . print_r($trace,true)); | 890 | + $default->log->info('Stack Trace: ' . print_r($trace, true)); |
| 878 | } | 891 | } |
| 879 | 892 | ||
| 880 | } | 893 | } |