#28722 [Bgs]: syslog() logs garbage

From: Date: Tue, 15 Jun 2004 08:19:59 +0000
Subject: #28722 [Bgs]: syslog() logs garbage
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-60931@lists.php.net to get a copy of this message
ID: 28722 User updated by: jjarven at softers dot net Reported By: jjarven at softers dot net Status: Bogus Bug Type: Unknown/Other Function Operating System: Linux 2.4.26 PHP Version: 4.3.7 New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [2004-06-11 15:36:24] iliaa@php.net Cannot replicate the bug, moreover you should not be calling syslog() without prior openlog() & define_syslog_variables() calls. ------------------------------------------------------------------------ [2004-06-10 09:53:33] 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: --------------- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28722&edit=1

« previous php.bugs (#60931) next »