logging-log4php-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Habunek <ivan.habu...@gmail.com>
Subject Re: Syslog appender bug?
Date Sat, 13 Aug 2011 05:53:52 GMT
Hi Chris,

I can confirm that this is a bug. The facility cannot be configured using
the strings as specified in the documentation. I will open an issue and we
will fix this.

In the meantime, you can use the integer values of the PHP constants used
for syslog facility, as listed here:

For example, if you want to use the LOCAL7 facility, you need to use the
integer value of the LOG_LOCAL7 constant which is 184. Therefore, something
log4php.appender.default = LoggerAppenderSyslog
log4php.appender.default.facility = 184

I will have to get back to you concerning the other issue, I'm off kayaking
today. :-)

Thanks for reporting the bug.

Best regards,

On 13 August 2011 02:31, Chris Toomey <ctoomey@gmail.com> wrote:

> Hi,
> I'm getting the following error when trying to use the syslog appender:
> PHP Warning:  openlog() expects parameter 3 to be long, string given in
> /home/ctoomey/hg/CouponsCom/
> webapp/zend/library/log4php/appenders/LoggerAppenderSyslog.php on line 190
> It's passing the string I specified in the log4php.ini -- "LOCAL7" instead
> of the corresponding int constant value.  So looks like this appender can't
> possibly work when configuring from .ini or .xml files, or otherwise unless
> you directly call setFacility() with a proper constant value.  Is anybody
> using this appender and if so, how are you getting around this?
> Also, do any of you know how to configure PHP to send STDERR messages to
> the Apache error log?  When I use the Console appender with either STDERR or
> STDOUT, my messages don't go into the apache error log and don't appear to
> be logged anywhere.  On the other hand, msgs. I write with PHP's error_log()
> do go to the error log.  Is anybody using the Console appender to
> successfully write to apache's error log?
> thx,
> Chris

View raw message