Mailing List Archive

Reduce error log
Dear Davical Team,

at the moment I'm porting our 1.1.1 Server to a new 1.1.3.1 one.
We are also using caldavzap which is very nice.
In error log we have a lot of lines like that:

[Tue Sep 15 09:53:58.887866 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: :***************** Response Header ****************, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887883 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: headers:-->Server: 1.1, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887897 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887911 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-proxy, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887925 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.3; DB/1.2.12, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887938 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: headers:-->Content-type: text/xml; charset="utf-8", referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887952 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: :******************** Response ********************, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887984 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--><?xml version="1.0" encoding="utf-8" ?>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.887998 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--><error xmlns="DAV:">, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888011 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> <need-privileges>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888038 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> <resource>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888052 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> <href>/davical/caldav.php/heiner/</href>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888066 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> <privilege>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888079 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> <read/>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888092 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> </privilege>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888105 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> </resource>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888118 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--> </need-privileges>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888131 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:--></error>, referer: https://xxx.uni-mannheim.de/caldavzap/
[Tue Sep 15 09:53:58.888160 2015] [:error] [pid 30972] [client 134.155.xx.xx:33964] davical: LOG: response:-->, referer: https://xxx.uni-mannheim.de/caldavzap/


This is produced from accessing the calendar via caldavzap, because we using a lot of "additionalResources" and not everybody have access to them.
We have about 100 principles in database and I like to reduce this logs.
In Config I have already:
$c->dbg = array( 'request' => 0, 'response' => 0 );

I figured out, that this is coming from inc/CalDAVRequest.php and I did a little patch to disable these 4xx errors.
For enabling the errors again, you have to put "$c->dbg['report4xxErrors'] = 1;" in config.php

If you like, you can add this in the source:

*** inc/CalDAVRequest.php.orig 2015-09-15 09:47:13.664000000 +0200
--- inc/CalDAVRequest.php 2015-09-15 09:57:18.888000000 +0200
***************
*** 1283,1294 ****
global $session, $c;
if ( !headers_sent() ) @header( sprintf("HTTP/1.1 %d %s", $status, getStatusMessage($status)) );
if ( !headers_sent() ) @header( sprintf("X-DAViCal-Version: DAViCal/%d.%d.%d; DB/%d.%d.%d", $c->code_major, $c->code_minor, $c->code_patch, $c->schema_major, $c->schema_minor, $c->schema_patch) );
if ( !headers_sent() ) header( "Content-type: ".$content_type );

if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['response']) && $c->dbg['response'])
! || $status == 400 || $status == 402 || $status == 403 || $status > 404 ) {
@dbg_error_log( "LOG ", 'Response status %03d for %s %s', $status, $this->method, $_SERVER['REQUEST_URI'] );
$lines = headers_list();
dbg_error_log( "LOG ", "***************** Response Header ****************" );
foreach( $lines AS $v ) {
dbg_error_log( "LOG headers", "-->%s", $v );
--- 1283,1296 ----
global $session, $c;
if ( !headers_sent() ) @header( sprintf("HTTP/1.1 %d %s", $status, getStatusMessage($status)) );
if ( !headers_sent() ) @header( sprintf("X-DAViCal-Version: DAViCal/%d.%d.%d; DB/%d.%d.%d", $c->code_major, $c->code_minor, $c->code_patch, $c->schema_major, $c->schema_minor, $c->schema_patch) );
if ( !headers_sent() ) header( "Content-type: ".$content_type );

+ // to enable errors, put "$c->dbg['report4xxErrors'] = 1;" in config.php
if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['response']) && $c->dbg['response'])
! || ( isset($c->dbg['report4xxErrors']) && $c->dbg['report4xxErrors'] && ( $status == 400 || $status == 402 || $status == 403 || $status > 404 ))) {
! // || $status == 400 || $status == 402 || $status == 403 || $status > 404 ) {
@dbg_error_log( "LOG ", 'Response status %03d for %s %s', $status, $this->method, $_SERVER['REQUEST_URI'] );
$lines = headers_list();
dbg_error_log( "LOG ", "***************** Response Header ****************" );
foreach( $lines AS $v ) {
dbg_error_log( "LOG headers", "-->%s", $v );




Sebastian

--
Sebastian Kotthoff
Rechenzentrum
Universit├Ąt Mannheim
B6, 23-29; Building B; Room 1.10
68159 Mannheim

Tel: +49 621 181 2516
Fax: +49 621 181 2682