Gaurav Sood
Gaurav Sood

Reputation: 690

Log description in Event Viewer while logging PHP information logs on IIS

I have a PHP website hosted on an IIS 8 Server running on Windows Server 2012. I have PHP 5.3.28 installed. I want to log information messages in Event Viewer. I have tried the following code:

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

I turned on error_reporting in php.ini and set error_log=syslog

The following is the entry in Event Viewer:

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

I feel that there is some configuration required in php.ini, but I am not able to ascertain what it would be so that I can provide a generic description for that log message.

Upvotes: 1

Views: 813

Answers (2)

Steltek
Steltek

Reputation: 119

Here's a registry file to import to register PHP as an event source (update the PHP version and DLL location in the appropriate places).

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-8.3.0]
"TypesSupported"=dword:00000007
"EventMessageFile"="D:\\php\\php8ts.dll"

Upvotes: 0

user1375602
user1375602

Reputation:

You can download reg file from here change PHP-5.3.99-dev to your version for example PHP-5.7.0 change EventMessageFile value from g:\test\srctrunkinstall\php7ts.dll to

Upvotes: 1

Related Questions