Logging to sepecific event source using NLog

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Logging to sepecific event source using NLog

I can able to log windows event source using NLog.

But what i want is to write a specific event source: such as : MyEventSource

My config is:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"


    <target name="eventlog" xsi:type="EventLog"  log="MyEventSource" />


    <logger name="*" minlevel="Trace" writeTo="eventlog" />

Well when i try to log anthing, MyEventSource is created but log message is written to general windows [7] applicantion event source not MyEventSource.