|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28722 syslog() logs garbage
Submitted: 2004-06-10 09:53 UTC Modified: 2004-06-15 10:19 UTC
From: jjarven at softers dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.3.7 OS: Linux 2.4.26
Private report: No CVE-ID: None
 [2004-06-10 09:53 UTC] jjarven at softers dot net
Note; this might relate to Bug 17648, thus have been around for a while. Hopefully bug will be finally fixed.

Logging messages to system log with plain syslog() (i.e. without using openlog() and define_syslog_variables())creates random garbage/text from memory preceding the actual message.

A line in any php-file:

syslog(LOG_NOTICE,"insert text here");

/var/log/messages showed:
Jun 10 08:34:30 mail ='crc' VALUE=': insert text here

The preceding text varies, sometimes it is correct (=nothing), sometimes it's longer.

The problem can be solved like this:
syslog(LOG_NOTICE,"insert text here")
Jun 10 08:36:12 mail Info: insert text here
Server is Apache 1.3.31 and php compiled as module.

Reproduce code:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-11 15:36 UTC]
Cannot replicate the bug, moreover you should not be 
calling syslog() without prior openlog() &  
define_syslog_variables() calls. 
 [2004-06-15 10:19 UTC] jjarven at softers dot net and openlog();
"openlog() is optional. It will automatically be called by syslog() if necessary, in which case ident will default to FALSE."

A Documentation problem then?
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jun 28 07:05:44 2022 UTC