« Cyrus SASL Static Plugin Patch | Main | PHP Native LDAP Patch for Windows »

Jan 21, 2010

PHP Syslog Patch for Windows

WARNING: This patch is only applicable when your PHP's mbstring.internal_encoding is UTF-8.

The current implementation of PHP's syslog() function cannot properly send UTF-8 strings to eventlog because it uses ReportEventA().  This patch translates UTF-8 internal encoding into WCHAR (UTF-16) and sends it using ReportEventW() to avoid string corruptions.

In addition, the current implementation maps LOG_ERR severity to eventlog's warning level, which I think misguided.  This patch changes the mapping of LOG_ERR to eventlog's error.

Download: php_syslog.patch

YAMAMOTO Hirotaka (tnnrg)


TrackBack URL for this entry:

Listed below are links to weblogs that reference PHP Syslog Patch for Windows:


Post a comment