php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jjarven at softers dot net
New email:
PHP Version: OS:

 

 [2004-06-10 09:53 UTC] jjarven at softers dot net
Description:
------------
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.

Example:
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:
define_syslog_variables();
openlog('Info:',LOG_ODELAY,LOG_USER);
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:
---------------
 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-11 15:36 UTC] iliaa@php.net
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
php.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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 18:01:29 2024 UTC