summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-04-23 18:12:42 +0000
committeralecpl <alec@alec.pl>2009-04-23 18:12:42 +0000
commit0ad27c384033977c86427011785d0182af91df4a (patch)
tree199cb88d2999f793cf99c4d1b484ada67f2db01b /program/include
parentf055b12f3ef5a15f1562869fcf5ecf00c94f2f7a (diff)
- Added log_date_format option (#1485709)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/bugs.inc5
-rw-r--r--program/include/main.inc9
2 files changed, 9 insertions, 5 deletions
diff --git a/program/include/bugs.inc b/program/include/bugs.inc
index 869022bcf..c5dac1e08 100644
--- a/program/include/bugs.inc
+++ b/program/include/bugs.inc
@@ -69,12 +69,15 @@ function log_bug($arg_arr)
global $CONFIG;
$program = strtoupper($arg_arr['type']);
+ if (empty($CONFIG['log_date_format']))
+ $CONFIG['log_date_format'] = 'd-M-Y H:i:s O';
+
// write error to local log file
if ($CONFIG['debug_level'] & 1)
{
$post_query = ($_SERVER['REQUEST_METHOD'] == 'POST' ? '?_task='.urlencode($_POST['_task']).'&_action='.urlencode($_POST['_action']) : '');
$log_entry = sprintf("[%s] %s Error: %s%s (%s %s)\n",
- date("d-M-Y H:i:s O", mktime()),
+ date($CONFIG['log_date_format']),
$program,
$arg_arr['message'],
$arg_arr['file'] ? sprintf(' in %s on line %d', $arg_arr['file'], $arg_arr['line']) : '',
diff --git a/program/include/main.inc b/program/include/main.inc
index b3d0dab2a..1149429ff 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -862,10 +862,11 @@ function write_log($name, $line)
if (!is_string($line))
$line = var_export($line, true);
-
- $log_entry = sprintf("[%s]: %s\n",
- date("d-M-Y H:i:s O", mktime()),
- $line);
+
+ if (empty($CONFIG['log_date_format']))
+ $CONFIG['log_date_format'] = 'd-M-Y H:i:s O';
+
+ $log_entry = sprintf("[%s]: %s\n", date($CONFIG['log_date_format']), $line);
if ($CONFIG['log_driver'] == 'syslog') {
if ($name == 'errors')