Skip to content

Commit fdef8a7

Browse files
committed
added eventlog appender doc
1 parent f90f3eb commit fdef8a7

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

src/site/antora/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
**** xref:manual/configuration/bufferingforwardingappender.adoc[]
2626
**** xref:manual/configuration/coloredconsoleappender.adoc[]
2727
**** xref:manual/configuration/consoleappender.adoc[]
28+
**** xref:manual/configuration/eventlogappender.adoc[]
2829
** xref:manual/examples.adoc[]
2930
** xref:manual/filters.adoc[]
3031
** xref:manual/layouts.adoc[]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
////
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
////
17+
18+
[#eventlogappender]
19+
= EventLogAppender
20+
21+
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.
22+
23+
[source,xml]
24+
----
25+
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
26+
<layout type="log4net.Layout.PatternLayout">
27+
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
28+
</layout>
29+
</appender>
30+
----
31+
32+
This example shows how to configure the EventLogAppender to use a specific event Source.
33+
34+
[source,xml]
35+
----
36+
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
37+
<applicationName value="MyApp" />
38+
<layout type="log4net.Layout.PatternLayout">
39+
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
40+
</layout>
41+
</appender>
42+
----

src/site/antora/modules/ROOT/pages/manual/configuration/examples.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ These examples are by no means exhaustive configurations for the appenders.
2525
* xref:manual/configuration/adonetappender.adoc[]
2626
* xref:manual/configuration/bufferingforwardingappender.adoc[]
2727
* xref:manual/configuration/coloredconsoleappender.adoc[]
28-
* xref:manual/configuration/consoleappender.adoc[]
28+
* xref:manual/configuration/consoleappender.adoc[]
29+
* xref:manual/configuration/eventlogappender.adoc[]

0 commit comments

Comments
 (0)