Title: [PATCH] EventLog display name patch

The current nt_eventlog implementation has the hardcoded "Apache Service" as the event log application name. This can be problematic if you have multiple instances of Apache running on the same box.

If, for instance, you register multiple apache services using different display names (-k install -n "My display name"), it is necessary that the events in the event log map to the actual service that generated it, not "Apache Service".

To fix this, I made midifications on two files:

The service.c.patch simply adds the display name used during -k install into the actual service command line.

For example if you run

Apache2.exe -k install -n "web server 1"

The service command like would be:

Apache2.exe -k runservice -n "web server 1"

Instead of

Apache2.exe -k runservice

This is important because the display_name variable will set when the service is executed. This variable is used by the nt_eventlog.c

The nt_eventlog.c patch replaces the hard-coded registry path SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\Apache Service

with

SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ + display_name

Now your messages will be loged with the right application name. So you can identify which service actually generated the error.

Juan

 

Attachment: service.c.path
Description: Binary data

Attachment: nt_eventlog.c.patch
Description: Binary data

Reply via email to