#23229 [NEW]: syslog function truncates messages

From: Date: Tue, 15 Apr 2003 20:20:59 +0000
Subject: #23229 [NEW]: syslog function truncates messages
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37721@lists.php.net to get a copy of this message
From:             cassano at monroe dot net
Operating system: Linux 2.4.18-27
PHP version:      4.3.1
PHP Bug Type:     *General Issues
Bug description:  syslog function truncates messages

The PHP syslog function is truncating messages longer than 500 characters
which is currently stopping our ability to respond to error states in our
multi-logging environment(i.e. things other than PHP).

Please change this to something more appropiate like 16384 bytes.


Here is the PHP syslog function.

/* {{{ proto bool syslog(int priority, string message)
   Generate a system log message */
PHP_FUNCTION(syslog)
{
    long priority;
    char *message;
    int message_len;

    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &priority,
                              &message, &message_len) == FAILURE) {
        return;
    }

    /*
     * CAVEAT: if the message contains patterns such as "%s",
     * this will cause problems.
     */

    php_syslog(priority, "%.500s", message);
    RETURN_TRUE;
}
/* }}} */
-- 
Edit bug report at http://bugs.php.net/?id=23229&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=23229&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=23229&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=23229&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=23229&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=23229&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=23229&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=23229&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=23229&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=23229&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=23229&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23229&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=23229&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=23229&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=23229&r=gnused



Thread (7 messages)

« previous php.bugs (#37721) next »