]> granicus.if.org Git - php/commitdiff
MFB - Add error_log option to log directly to SAPI
authorStanislav Malyshev <stas@php.net>
Thu, 13 Nov 2008 18:51:21 +0000 (18:51 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 13 Nov 2008 18:51:21 +0000 (18:51 +0000)
ext/standard/basic_functions.c

index 6b9370245987bee655717a9c2d34caa43bfe4540..42adf7c0323421447c3c0e019620635ef82f59c4 100644 (file)
@@ -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;