////
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
////

[#eventlogappender]
= EventLogAppender

The EventLogAppender in log4net logs messages to the Windows Event Log.
It is limited to .Net 4.x because it is Windows specific and .netstandard lacks support for writing to the Event Log.

The following example shows how to configure the `EventLogAppender` to log to the Application event log on the local machine using the event Source of the AppDomain.FriendlyName.

[source,xml]
----
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
  </layout>
</appender>
----

This example shows how to configure the `EventLogAppender` to use a specific event Source.

[source,xml]
----
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
  <applicationName value="MyApp" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
  </layout>
</appender>
----