! -> Note
$ -> Affected files
+16-Jun-2009 Janusz Dobrowolski
+! Added error logging to file or syslog.
+$ /config.php
+ /includes/errors.inc
+
15-Jun-2009 Joe Hunt
! Added Item Code Entry in Work Order Entry and quantity decimals now follows the item
! Clean-up in ui_list codes.
if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root']))
die("Restricted access");
-
+ // Log file for error/warning messages. Should be set to any location
+ // writable by www server. When set to empty string logging is switched off.
+ // Special value 'syslog' can be used for system logger usage (see php manual).
+ $error_logfile = dirname(__FILE__).'/tmp/errors.log';
$debug = 1;
$show_sql = 0;
$go_debug = 0;
// ini_alter("error_reporting","E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE");
ini_set("display_errors", "On");
}
+
+ if($error_logfile != '') {
+ ini_set("error_log", $error_logfile);
+ ini_set("ignore_repeated_errors", "On");
+ ini_set("log_errors", "On");
+ }
// Main Title
$app_title = "FrontAccounting";
// application version
global $messages;
// error_reporting==0 when messages are set off with @
- if ($errno & error_reporting()) {
- $messages[] = array($errno, $errstr, $file, $line);
+ if ($errno) {
+ if(error_reporting())
+ $messages[] = array($errno, $errstr, $file, $line);
+
+ $ignored = E_USER_WARNING|E_USER_ERROR|E_USER_NOTICE;
+ // don't log notices hidden with @ unless in debug mode
+ if (!$go_debug) $ignored |= E_NOTICE;
+
+ if (!($errno & $ignored))
+ error_log(
+ user_company().':'.$_SESSION["wa_current_user"]->loginname.':'.
+ basename($file).":$line: $errstr");
}
return true;
}