Req #49467 [Com]: Errors are logged to syslog using LOG_NOTICE instead of LOG_ERR
[email protected] ("jani dot ollikainen at valve dot fi")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=49467&edit=1
ID: 49467
Comment by: jani dot ollikainen at valve dot fi
Reported by: toby dot walsh at fxhome dot com
Summary: Errors are logged to syslog using LOG_NOTICE instead
of LOG_ERR
Status: Open
Type: Feature/Change Request
Package: PHP options/info functions
Operating System: *
PHP Version: *
Block user comment: N
Private report: N
New Comment:
Hi,
Why would you want those to be using single level?
How about https://github.com/php/php-src/pull/1702 ?
Previous Comments:
------------------------------------------------------------------------
[2014-02-12 09:19:38] joop_boonen at web dot de
I also have exectly the same problem.
Will this issue be solved in the near future?
For me it would be an option that the default log level could be set. So that the logs aren't recorded as notice but my prefered log level.
But ofcource the only right solution would be that the logs would have the correct level, where you can also filter on.
------------------------------------------------------------------------
[2009-09-04 12:42:49] toby dot walsh at fxhome dot com
Description:
------------
I'm using "error_log = syslog" in my php.ini to log all errors to syslog. But the errors end up being logged using the LOG_NOTICE log level instead of the LOG_ERR level.
I've traced this back to the internal php_log_err function in main/main.c which uses
php_syslog(LOG_NOTICE, "%.500s", log_message);
when it should probably be using
php_syslog(LOG_ERR, "%.500s", log_message);
Reproduce code:
---------------
Set the following directives in php.ini
error_reporting = E_ALL & ~E_NOTICE
log_errors = On
error_log = syslog
Then generate a syntax error with something like
<?php test( ?>
Expected result:
----------------
An error message should be logged to syslog with a log level of LOG_ERR
Actual result:
--------------
The error message is logged, but using a log level of LOG_NOTICE instead of LOG_ERR
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=49467&edit=1