diff options
author | thomascube <thomas@roundcube.net> | 2009-07-21 16:40:27 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2009-07-21 16:40:27 +0000 |
commit | a0c4cbe8ece6397950eb2b14bc239ce389c7b0a1 (patch) | |
tree | f6fb4bd6924a5975304659a529bd925aac1f4621 | |
parent | 2a5d02ab8ea2e80d7d73f90b1d31994def0c7c43 (diff) |
Pipe date string through write_log plugin hook (#1485979)
-rw-r--r-- | program/include/main.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 3099a7290..ba2f690af 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -995,16 +995,19 @@ function write_log($name, $line) if (empty($CONFIG['log_date_format'])) $CONFIG['log_date_format'] = 'd-M-Y H:i:s O'; + $date = date($CONFIG['log_date_format']); + // trigger logging hook if (is_object($RCMAIL) && is_object($RCMAIL->plugins)) { - $log = $RCMAIL->plugins->exec_hook('write_log', array('name' => $name, 'line' => $line)); + $log = $RCMAIL->plugins->exec_hook('write_log', array('name' => $name, 'date' => $date, 'line' => $line)); $name = $log['name']; $line = $log['line']; + $date = $log['date']; if ($log['abort']) return; } - $log_entry = sprintf("[%s]: %s\n", date($CONFIG['log_date_format']), $line); + $log_entry = sprintf("[%s]: %s\n", $date, $line); if ($CONFIG['log_driver'] == 'syslog') { $prio = $name == 'errors' ? LOG_ERR : LOG_INFO; |