在IIS上记录PHP信息日志时,在事件查看器中记录日志

时间:2016-01-29 08:07:27

标签: php iis logging

我在Windows Server 2012上运行的IIS 8服务器上托管了一个PHP网站。我安装了PHP 5.3.28。我想在事件查看器中记录信息消息。我尝试了以下代码:

openlog('php', LOG_CONS | LOG_NDELAY | LOG_PID, LOG_USER | LOG_PERROR);
syslog(LOG_INFO, 'This is a message');
closelog();

我在 php.ini 中启用 error_reporting 并设置 error_log = syslog

以下是事件查看器中的条目:

The description for Event ID 2 from source PHP-5.3.28 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

php[10052]
This is a message

我觉得php.ini需要一些配置,但我无法确定它会是什么,以便我可以为该日志消息提供一般描述。

1 个答案:

答案 0 :(得分:1)

您可以从here下载reg文件 将PHP-5.3.99-dev更改为您的版本,例如PHP-5.7.0 将EventMessageFile值从g:\ test \ srctrunkinstall \ php7ts.dll更改为

相关问题