diff --git a/inc/log_caldav_action.php b/inc/log_caldav_action.php index 7639d7c2..1f56546b 100644 --- a/inc/log_caldav_action.php +++ b/inc/log_caldav_action.php @@ -24,17 +24,20 @@ * @param string $dav_name The DAV path of the item, relative to the DAViCal base path */ function log_caldav_action( $action_type, $uid, $user_no, $collection_id, $dav_name ) { - global $c; - $logline = sprintf( '%s %s %s %s %s %s', gmdate('Ymd\THis\Z'), $action_type, $uid, $user_no, $collection_id, $dav_name ); - if ( !isset($c->action_log_name) ) { - error_log( $logline ); - return; - } + $logline = sprintf( '%s, %s, %s, %s, %s', $action_type, $uid, $user_no, $collection_id, $dav_name ); - $logline .= "\n"; + openlog('davical', LOG_PID, LOG_LOCAL0); + syslog(LOG_INFO, $logline); + closelog(); + +} +function post_commit_action( $action_type, $uid, $user_no, $collection_id, $dav_name ) { + + $logline = sprintf( '%s, %s, %s, %s, %s', $action_type, $uid, $user_no, $collection_id, $dav_name ); + + openlog('davical', LOG_PID, LOG_LOCAL0); + syslog(LOG_INFO, $logline); + closelog(); - $logfile = fopen( $c->action_log_name, "a+" ); - fwrite( $logfile, $logline ); - fclose($logfile); }