Nginx stopped writing to error log

System:

Freebsd 12.1-RELEASE-p10
nginx-1.18.0_25,2

Nginx stopped writing to error log files yesterday for all domains. Its still properly logging to access log file.

No recent changes on the system (no updates, upgrades etc....)

There is no problem with log file permissions:

Code:
-rw-r-----  1 www   wheel   4.0M Dec 22 18:47 system.testdomain.com.access.log
-rw-r-----  1 www   wheel   5.2K Dec 22 18:34 system.testdomain.com.error.log
-rw-r-----  1 www   wheel   351K Dec 22 18:24 www.testdomain.com.access.log
-rw-r-----  1 www   wheel    54K Dec 22 10:55 www.testdomain.com.error.log
There is no problem with free space:

Code:
root@system:/var/log/nginx # df -h
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/gpt/rootfs     22G    4.0G     16G    20%    /
Nginx running properly:

Code:
root@system:/var/log/nginx # ps -aux | grep nginx
root     723   0.0  1.0  31340  9668  -  Is   18:46    0:00.00 nginx: master process /usr/local/sbin/nginx
www      725   0.0  1.0  31612 10472  -  I    18:46    0:00.02 nginx: worker process (nginx)
Nginx conf file section:

Code:
server {
        server_name system.testdomain.com;
        access_log  /var/log/nginx/system.testdomain.com.access.log;
        error_log  /var/log/nginx/system.testdomain.com.error.log;

        root /usr/local/www/nginx/system.testdomain.com;

//Rest of the file is omitted

Note: tried restarting nginx and restarting system, no result

Appreciate any help
 
Update:

Enabled debug level in nginx conf as:
error_log /var/log/nginx/system.testdomain.com.error.log debug;
Nginx started writing logs in error log file again

removed "error_log=/var/log/nginx/php.scripts.log" directive from php.ini
Nginx started to write php errors into /var/log/nginx/system.testdomain.com.error.log

Now everything runs normal but above actions still doesnt explain why it stopped working in the first place.

Will keep this thread open for couple days in case;

Someone might have a idea about why it stopped working in the first place or might point to a direction to debug this issue further

Thanks
 
  • Thanks
Reactions: im
Back
Top