Changeset 7765 for trunk/src/inc/LogHandler.class.php
- Timestamp:
- Apr 15, 2010, 12:00:44 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/src/inc/LogHandler.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/inc/LogHandler.class.php
r7753 r7765 88 88 echo '<!-- ' . $errorString . ' -->'; 89 89 } 90 if ( $logno <= LOG_LEVEL_WRITE) {90 if ((!defined('IGNORE_LOG_LEVEL_WRITE')) && ($logno <= LOG_LEVEL_WRITE)) { 91 91 $filename = 'logfile.txt'; 92 92 if (is_writable($filename)) { 93 93 94 94 //Check if the file can be opened 95 if (!$handle = fopen($filename, 'w')) {96 define('LOG_LEVEL_WRITE', LOG_LEVEL_NONE);97 trigger_log(SYSLOG_EMERG, 'Cannot open file "' . $filename . '"', __FILE__, __LINE__);98 exit;95 if (!$handle = fopen($filename, 'w')) { 96 define('IGNORE_LOG_LEVEL_WRITE', true); 97 trigger_log(SYSLOG_EMERG, 'Cannot open file "' . $filename . '"', __FILE__, __LINE__); 98 exit; 99 99 } 100 100 101 101 // Write $errorString to file. 102 102 if (fwrite($handle, $errorString) === FALSE) { … … 105 105 exit; 106 106 } 107 107 108 108 fclose($handle); 109 109 110 110 } else { 111 define(' LOG_LEVEL_WRITE', LOG_LEVEL_NONE);112 trigger_log(SYSLOG_EMERG, 'Cannot write to "' . $filename . '"', __FILE__, __LINE__);111 define('IGNORE_LOG_LEVEL_WRITE', true); 112 trigger_log(SYSLOG_EMERG, 'Cannot write to "' . $filename . '"', __FILE__, __LINE__); 113 113 } 114 114 } 115 115 116 116 if ($logno <= LOG_LEVEL_MAIL) { 117 117 mail('test@test.com', 'Nodemap error', $errorString);
Note:
See TracChangeset
for help on using the changeset viewer.
