How to create Windows EventLog source from command line?

后端 未结 8 1536
温柔的废话
温柔的废话 2020-11-27 09:28

I\'m creating an ASP.NET application that will log some stuff to Windows EventLog. To do this an event source has to be created first. This requires administrative priviledg

8条回答
  •  遥遥无期
    2020-11-27 10:03

    If someone is interested, it is also possible to create an event source manually by adding some registry values.

    Save the following lines as a .reg file, then import it to registry by double clicking it:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\YOUR_EVENT_SOURCE_NAME_GOES_HERE]
    "EventMessageFile"="C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\EventLogMessages.dll"
    "TypesSupported"=dword:00000007
    

    This creates an event source named YOUR_EVENT_SOURCE_NAME_GOES_HERE.

提交回复
热议问题