pear/Log — Issue #1: Notice when using syslog with adjusted priority
Author: jvwag
Created: 2011-11-11 10:32:32+00:00
State: open

A notice is given when using syslog. This is caused by syslog.php adjusting the priority to a syslog compatible value but sending it back to _format() and forward to _announce() which expect the PEAR Log constant.

PHP Notice: Undefined offset: 134 in /usr/share/pear/Log.php on line 589
PHP Stack trace:
PHP 1. {main}() test.php:0
PHP 2. Log_syslog->log($message = 'Test', $priority = 6) test.php:10
PHP 3. Log->_format($format = '%4$s', $timestamp = 'Nov 11 10:50:01', $priority = 134, $message = 'Test') /usr/share/pear/Log/syslog.php:184
PHP 4. Log->priorityToString($priority = 134) /usr/share/pear/Log.php:558

Fix is to rename the adjusted priority value and only use it in the syslog() call.