php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49467 Errors are logged to syslog using LOG_NOTICE instead of LOG_ERR
Submitted: 2009-09-04 12:42 UTC Modified: 2016-06-02 12:36 UTC
Votes:7
Avg. Score:4.7 ± 0.5
Reproduced:7 of 7 (100.0%)
Same Version:1 (14.3%)
Same OS:3 (42.9%)
From: toby dot walsh at fxhome dot com Assigned: ab (profile)
Status: Closed Package: PHP options/info functions
PHP Version: * OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: toby dot walsh at fxhome dot com
New email:
PHP Version: OS:

 

 [2009-09-04 12:42 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-29 13:14 UTC] jani@php.net
-Package: Feature/Change Request +Package: PHP options/info functions
 [2010-12-29 13:15 UTC] jani@php.net
-Operating System: Linux +Operating System: * -PHP Version: 5.2.10 +PHP Version: *
 [2014-02-12 09:19 UTC] 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.
 [2015-12-29 10:29 UTC] jani dot ollikainen at valve dot fi
Hi,

Why would you want those to be using single level?

How about https://github.com/php/php-src/pull/1702 ?
 [2016-06-02 12:36 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-06-02 12:36 UTC] ab@php.net
PR #1702 merged for 7.1.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC