简体   繁体   中英

Remove delay from php's error_log file

I can't find an answer to this anywhere, so I'm asking here.

I'm just wondering if there's a way where I can see an error instantly printed into the php's error_log file when the error happens. Right now, my server is a standard setup running with cpanel/whm and the CPU usage and memory usage are always at normal levels.

The crazy thing is when errors happen, it seems I have to wait five minutes or more to see the entry in the php error_log file. If I check the log file right after I generate the error, then it doesn't get printed.

What can I do to minimize the waiting time for new errors to appear in the php's error_log file from the time the errors happen?

It is a workaround not solution for the delay isssue. You can add this line at the end of your function

error_log(PHP_EOL, 3, $file);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM