diff options
author | Stanislav Malyshev <stas@php.net> | 2008-11-13 18:51:21 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2008-11-13 18:51:21 +0000 |
commit | 01deabb5cdc6edf490b83e4ca51150b605d37cd3 (patch) | |
tree | b7e2a4c867a2dc928596f6cabd997a32876b253f /ext/standard/basic_functions.c | |
parent | c037b6175f7c397fec97fa23830b69c6bea45bec (diff) | |
download | php-git-01deabb5cdc6edf490b83e4ca51150b605d37cd3.tar.gz |
MFB - Add error_log option to log directly to SAPI
Diffstat (limited to 'ext/standard/basic_functions.c')
-rw-r--r-- | ext/standard/basic_functions.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6b93702459..42adf7c032 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5023,6 +5023,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]]]) @@ -5076,7 +5077,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; |