From 6c5f5157d6e0416c85346abcc7dfaff8054c0398 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 13 Mar 2012 08:33:08 +1300 Subject: [PATCH] Don't log 401 response since it's so frequent. Also add a basic status/method/uri in front of each logged error. --- inc/CalDAVRequest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/CalDAVRequest.php b/inc/CalDAVRequest.php index 26b6c542..d95b4f6e 100644 --- a/inc/CalDAVRequest.php +++ b/inc/CalDAVRequest.php @@ -1185,7 +1185,8 @@ EOSQL; @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) ); @header( "Content-type: ".$content_type ); - if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['response']) && $c->dbg['response']) || $status > 399 ) { + if ( (isset($c->dbg['ALL']) && $c->dbg['ALL']) || (isset($c->dbg['response']) && $c->dbg['response']) || $status == 400 || $status > 401 ) { + @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 ) {