thomascube
2009-07-21 a0c4cbe8ece6397950eb2b14bc239ce389c7b0a1
Pipe date string through write_log plugin hook (#1485979)

1 files modified
7 ■■■■ changed files
program/include/main.inc 7 ●●●● patch | view | raw | blame | history
program/include/main.inc
@@ -995,16 +995,19 @@
  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;