Bug #79070 [Com]: PHP suddenly stops logging errors until Apache2 is restarted

From: Date: Sat, 18 Jan 2020 19:22:54 +0000
Subject: Bug #79070 [Com]: PHP suddenly stops logging errors until Apache2 is restarted
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224976@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79070&edit=1

 ID:                 79070
 Comment by:         solusvm at web dot de
 Reported by:        solusvm at web dot de
 Summary:            PHP suddenly stops logging errors until Apache2 is
                     restarted
 Status:             Open
 Type:               Bug
 Package:            Apache2 related
 Operating System:   Debian 10.2
 PHP Version:        7.4.1
 Block user comment: N
 Private report:     N

 New Comment:

Thank you very much for the explanation, that will definitely be the reason. I hadn't thought
of that.


Previous Comments:
------------------------------------------------------------------------
[2020-01-18 02:26:26] bugreports at gmail dot com

> Where is the difference between editing with sed/vim and nano? 

pretty sure by write directly in the file or atomic new file->rename
see "tail -f" versus "tail -F"

the webserver happily still logs in his open handle which got in the meantime deleted and after
restart the webserver it's thrown away because the last process (the webserver) is closing it
and at start it just opens the new file you created in the meantime

that's how filehandles are working on Unix

------------------------------------------------------------------------
[2020-01-18 02:03:04] solusvm at web dot de

Now I noticed that this issue appears when I edit the Apache2 log file when the webserver is
running. But it's only caused by editing the file using sed or vim in my case. When I use nano,
I can edit it and Apache2 will still append new lines to it.

Where is the difference between editing with sed/vim and nano? I use sed for quite a long time now
to remove certain lines from my Apache2 logs and I'm quite sure that I never faced this issue
before about December 19...

------------------------------------------------------------------------
[2020-01-06 12:07:51] solusvm at web dot de

Description:
------------
I'm using PHP 7.4.1 with Apache2 (libapache2-mod-php7.4, Version:
7.4.1-1+0~20191218.8+debian10~1.gbp21c50e) on my Debian 10.2 system and I'm facing an issue
since about December 23. Because I upgraded from PHP 7.4.0 to 7.4.1 on December 19 and I never
experienced this issue before, I guess this issue/bug is related to PHP 7.4.1 or the corresponding
Apache2 PHP module.

The logging works fine but after a few days it suddenly stops to log PHP errors, warnings etc. in my
"error.log" file. Apache2 logging still works, but just the PHP errors aren't logged
anymore. I'm also getting no error or exception when calling the "error_log" function
manually and I can't find anything in other logs that could explain this.

When I restart the Apache2 server (and thus also the PHP module), the logging starts working but
after a few days it'll stop logging PHP errors again.

I have these modules installed: bz2, cli, common, curl, gd, intl, json, mbstring, mysql, opcache,
readline, soap, xml, xsl, zip, geoip and I changed nothing in the last months. I just upgraded from
PHP 7.4.0 to 7.4.1 on December 19 and then this issue started to happen. So it looks like it could
be the new PHP version but I need the logging to work without suddenly stopping...



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=79070&edit=1


Thread (6 messages)

« previous php.bugs (#224976) next »