7

Added an EventLogAppender as follows:

<appender name="eventLogAppender" type="log4net.Appender.EventLogAppender,log4net" >
    <mapping>
        <level value="ERROR" />
        <eventLogEntryType value="Error" />
    </mapping>
    <mapping>
        <level value="DEBUG" />
        <eventLogEntryType value="Information" />
    </mapping>
    <mapping>
        <level value="INFO" />
        <eventLogEntryType value="Information" />
    </mapping>
    <mapping>
        <level value="WARN" />
        <eventLogEntryType value="Warning" />
    </mapping>
    <logName value="NewLogName" />
    <applicationName value="AppName" />
    <layout type="log4net.Layout.PatternLayout,log4net">
        <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
    </layout>
</appender>

It creates the new log of NewLogName and it adds windows events with the app name of AppName but it adds the events to the Application log instead of NewLogName.

I've changed permissions in the registry and the Application Name is in the correct spot in the registry. Any ideas?

Mike Lowery
  • 2,630
  • 4
  • 34
  • 44
rhessinger
  • 173
  • 2
  • 8
  • And the debug output from log4net doesn't complain about anything (Add ``)? Because tons of other Q&As about this same thing say that you're _configuring_ it correctly (permissions are another question). – Anthony Mastrean Jun 22 '11 at 01:13
  • possible duplicate of [Configuring a custom event log for log4net](http://stackoverflow.com/questions/2416800/configuring-a-custom-event-log-for-log4net) – Anthony Mastrean Jun 22 '11 at 01:15

1 Answers1

5

After enabling log4net internal debugging, I didn't see any errors. It created the NewLogName in the Event Viewer. There is no duplicate. I restarted the Event Collector and the Event Log services and it didn't fix it. I rebooted my computer last night and it looks like that fixed it.

Mike Lowery
  • 2,630
  • 4
  • 34
  • 44
rhessinger
  • 173
  • 2
  • 8