]> granicus.if.org Git - php/commitdiff
- Added fastcgi.logging php.ini option to be able to disable
authorfoobar <sniper@php.net>
Thu, 28 Apr 2005 13:14:26 +0000 (13:14 +0000)
committerfoobar <sniper@php.net>
Thu, 28 Apr 2005 13:14:26 +0000 (13:14 +0000)
  logging through the fastcgi connection

php.ini-dist
php.ini-recommended
sapi/cgi/cgi_main.c

index 75af31cbd2c952aaf3f75826607cae6deb97a91c..9ba5721cd23f3d0bbee70e5cb3837a5958136f78 100644 (file)
@@ -481,6 +481,9 @@ enable_dl = On
 ; Set to 1 if running under IIS.  Default is zero.
 ; fastcgi.impersonate = 1;
 
+; Disable logging through FastCGI connection
+; fastcgi.log = 0
+
 ; cgi.rfc2616_headers configuration option tells PHP what type of headers to
 ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
 ; is supported by Apache. When this option is set to 1 PHP will send
index 101eebb0688bb118db9a59b148c1af610882a728..c5ad526bc51e9b20c840cca9e368fec588fb90af 100644 (file)
@@ -539,6 +539,9 @@ enable_dl = On
 ; Set to 1 if running under IIS.  Default is zero.
 ; fastcgi.impersonate = 1;
 
+; Disable logging through FastCGI connection
+; fastcgi.log = 0
+
 ; cgi.rfc2616_headers configuration option tells PHP what type of headers to
 ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
 ; is supported by Apache. When this option is set to 1 PHP will send
index 9cc8d220a50bf6b8b88c817e087c8e770b685e23..a3394a6b66c60bc2ad8143449d995b024d49ca48 100644 (file)
@@ -482,9 +482,14 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
 static void sapi_cgi_log_message(char *message)
 {
 #if PHP_FASTCGI
+       int logging = 1;
        TSRMLS_FETCH();
 
-       if (!FCGX_IsCGI()) {
+       if (cfg_get_long("fastcgi.logging", &logging) == FAILURE) {
+               logging = 1;
+       }
+                                                                                                        
+       if (!FCGX_IsCGI() && logging) {
                FCGX_Request *request = (FCGX_Request *)SG(server_context);
                FCGX_FPrintF( request->err, "%s\n", message );
                /* ignore return code */