I am logging information into the windows event viewer.
This is what I have in my log4net config file.
<logger name="MyLogger">
<level value="all"/>
<appender-ref ref="EventLogAppender"/>
</logger>
<!-- Windows Event Viewer appender -->
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
I'm seeing a new information event every time I'm logging with that logger in my application and I see that in Windows Event Viewer -> Windows Logs -> Application.
Is there a way to log in a specific journal or one that I create from my application?
Like instead of Application
, it would be MyWebApplication
.
Also, I have 2 web applications running at the same time. They both have their log4net config file with different loggers. It doesn't seem to work when I try to log events from the 2 web applications. (I set them different applicationName... <applicationName value="app1" /> <applicationName value="app2" />
). It will always log with the first one name even if it's 2 different config file and 2 different applicationName.