From: Stanislav Malyshev Date: Thu, 13 Nov 2008 18:48:25 +0000 (+0000) Subject: [DOC] Add option for error_log to send directly to SAPI logger X-Git-Tag: php-5.3.0alpha2~163 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a5079e64c66d6b0d2c1548ad0b033d7699899a2;p=php [DOC] Add option for error_log to send directly to SAPI logger --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index e1f314b9c4..825ca37749 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5084,6 +5084,7 @@ error options: 1 = send via email to 3rd parameter 4th option = additional headers 2 = send via tcp/ip to 3rd parameter (name or ip:port) 3 = save to file in 3rd parameter + 4 = send to SAPI logger directly */ /* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]]) @@ -5137,7 +5138,13 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T php_stream_write(stream, message, strlen(message)); php_stream_close(stream); break; - + case 4: /* send to SAPI */ + if (sapi_module.log_message) { + sapi_module.log_message(message); + } else { + return FAILURE; + } + break; default: php_log_err(message TSRMLS_CC); break;