Is it possible to disable PHP slow log per script?

1k Views Asked by At

I have one script on my webpage which process a lot of informations and It should be slow. But php-fpm is terminating it, because of slow log.

I just see in logs NOTICE: child 26537 stopped for tracing and web server throws me 504 error.

I tried to disable slow log by ini_set

 ini_set('request_slowlog_timeout',0);

but it is not working. I am using php 7.1 latest version

1

There are 1 best solutions below

0
On

You try do do with php.ini (no report log errors)

ini_set("log_errors", 0); 

what you can to do on your vhost configuration example : (mean no output log generate for this host)

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName myapp.dev
    ServerAlias www.myapp.dev
    DocumentRoot /home/vagrant/code/public
    ErrorLog /dev/null
    CustomLog /dev/null common
</VirtualHost>

For the slow logs, try to solve why you got some slow log and add a strategic action on PHP code for this. Regards.