Skip to content

Commit f4d2992

Browse files
committed
added remaining appenders doc
1 parent 2e58cdc commit f4d2992

15 files changed

+460
-22
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
**** xref:manual/configuration/eventlogappender.adoc[]
2929
**** xref:manual/configuration/fileappender.adoc[]
3030
**** xref:manual/configuration/rollingfileappender.adoc[]
31+
**** xref:manual/configuration/forwardingappender.adoc[]
32+
**** xref:manual/configuration/managedcoloredconsoleappender.adoc[]
33+
**** xref:manual/configuration/memoryappender.adoc[]
34+
**** xref:manual/configuration/outputdebugstringappender.adoc[]
35+
**** xref:manual/configuration/smtpappender.adoc[]
36+
**** xref:manual/configuration/traceappender.adoc[]
37+
**** xref:manual/configuration/udpappender.adoc[]
3138
** xref:manual/examples.adoc[]
3239
** xref:manual/faq.adoc[]
3340
** xref:manual/filters.adoc[]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
[#bufferingforwardingappender]
1919
= BufferingForwardingAppender
2020
21-
The following example shows how to configure the BufferingForwardingAppender to buffer 100 messages before delivering them to the ConsoleAppender.
21+
The following example shows how to configure the `BufferingForwardingAppender` to buffer 100 messages before delivering them to the `ConsoleAppender`.
2222
2323
[source,xml]
2424
----
2525
<appender name="BufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
2626
<bufferSize value="100"/>
2727
<!--
28-
The value configures what gets fixed immediately when calling logger.Log().
28+
The value configures what gets fixed immediately when calling logger.Log().
2929
The default value is All, which may negatively impact performance enough to warrant changing it to fix less data.
3030
More information can be found at https://github.com/apache/logging-log4net/blob/master/src/log4net/Core/FixFlags.cs
31-
-->
31+
-->
3232
<fix value="All"/>
3333
<appender-ref ref="ConsoleAppender" />
3434
</appender>
@@ -39,7 +39,7 @@ This example shows how to deliver only significant events.
3939
A LevelEvaluator is specified with a threshold of WARN.
4040
This means that the events will only be delivered when a message with level of WARN or higher level is logged.
4141
42-
Up to 512 (BufferSize) previous messages of any level will also be delivered to provide context information.
42+
Up to 512 `bufferSize` previous messages of any level will also be delivered to provide context information.
4343
Messages not sent will be discarded.
4444
4545
[source,xml]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[#consoleappender]
1919
= ConsoleAppender
2020
21-
The following example shows how to configure the ConsoleAppender to log messages to the console.
21+
The following example shows how to configure the `ConsoleAppender` to log messages to the console.
2222
By default the messages are sent to the console standard output stream.
2323
2424
[source,xml]

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[#eventlogappender]
1919
= EventLogAppender
2020
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.
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.
2222
2323
[source,xml]
2424
----
@@ -29,7 +29,7 @@ The following example shows how to configure the EventLogAppender to log to the
2929
</appender>
3030
----
3131
32-
This example shows how to configure the EventLogAppender to use a specific event Source.
32+
This example shows how to configure the `EventLogAppender` to use a specific event Source.
3333
3434
[source,xml]
3535
----

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ These examples are by no means exhaustive configurations for the appenders.
2828
* xref:manual/configuration/consoleappender.adoc[]
2929
* xref:manual/configuration/eventlogappender.adoc[]
3030
* xref:manual/configuration/fileappender.adoc[]
31-
* xref:manual/configuration/rollingfileappender.adoc[]
31+
* xref:manual/configuration/rollingfileappender.adoc[]
32+
* xref:manual/configuration/forwardingappender.adoc[]
33+
* xref:manual/configuration/managedcoloredconsoleappender.adoc[]
34+
* xref:manual/configuration/memoryappender.adoc[]
35+
* xref:manual/configuration/outputdebugstringappender.adoc[]
36+
* xref:manual/configuration/smtpappender.adoc[]
37+
* xref:manual/configuration/smtppickupdirappender.adoc[]
38+
* xref:manual/configuration/traceappender.adoc[]
39+
* xref:manual/configuration/udpappender.adoc[]

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
[#fileappender]
1919
= FileAppender
2020
21-
The following example shows how to configure the FileAppender to write messages to a file.
21+
The following example shows how to configure the `FileAppender` to write messages to a file.
2222
The file specified is log-file.txt.
23-
The file will be appended to rather than overwritten each time the logging process starts.
23+
The file will be appended to rather than overwritten each time the logging process starts.
2424
2525
[source,xml]
2626
----
@@ -34,7 +34,7 @@ The file will be appended to rather than overwritten each time the logging proce
3434
----
3535
3636
This example shows how to configure the file name to write to using an environment variable TEMP.
37-
The encoding to use to write to the file is also specified.
37+
The encoding to use to write to the file is also specified.
3838
3939
[source,xml]
4040
----
@@ -53,11 +53,11 @@ This example shows how to configure the appender to use the minimal locking mode
5353
[source,xml]
5454
----
5555
<appender name="FileAppender" type="log4net.Appender.FileAppender">
56-
<file value="log-file.txt" />
57-
<appendToFile value="true" />
58-
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
59-
<layout type="log4net.Layout.PatternLayout">
60-
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
61-
</layout>
56+
<file value="log-file.txt" />
57+
<appendToFile value="true" />
58+
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
59+
<layout type="log4net.Layout.PatternLayout">
60+
<conversionPattern value="%date [%thread] %-5level %logger %message%newline" />
61+
</layout>
6262
</appender>
6363
----
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
[#forwardingappender]
19+
= ForwardingAppender
20+
21+
The following example shows how to configure the `ForwardingAppender`.
22+
The forwarding appender allows a set of constraints to be used to decorate an appender.
23+
24+
In this example the `ConsoleAppender` is decorated with a Threshold of level WARN. This means that an event directed to the `ConsoleAppender` directly will be logged regardless of its level, but an event directed to the `ForwardingAppender` will only be passed on to the `ConsoleAppender` if its level is WARN or higher.
25+
26+
This appender is used only in special circumstances.
27+
28+
[source,xml]
29+
----
30+
<appender name="ForwardingAppender" type="log4net.Appender.ForwardingAppender" >
31+
<threshold value="WARN"/>
32+
<appender-ref ref="ConsoleAppender" />
33+
</appender>
34+
----
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
[#managedcoloredconsoleappender]
19+
= ManagedColoredConsoleAppender
20+
21+
The following example shows how to configure the `ManagedColoredConsoleAppender` to log messages to the console.
22+
By default the messages are sent to the console standard output stream.
23+
24+
This example shows how to highlight error messages.
25+
26+
[source,xml]
27+
----
28+
<appender name="ManagedColoredConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
29+
<mapping>
30+
<level value="ERROR" />
31+
<foreColor value="White" />
32+
<backColor value="Red" />
33+
</mapping>
34+
<layout type="log4net.Layout.PatternLayout">
35+
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
36+
</layout>
37+
</appender>
38+
----
39+
40+
This example shows how to colorize multiple levels.
41+
42+
[source,xml]
43+
----
44+
<appender name="ManagedColoredConsoleAppender" type="log4net.Appender.ManagedColoredConsoleAppender">
45+
<mapping>
46+
<level value="ERROR" />
47+
<foreColor value="DarkRed" />
48+
</mapping>
49+
<mapping>
50+
<level value="WARN" />
51+
<foreColor value="Yellow" />
52+
</mapping>
53+
<mapping>
54+
<level value="INFO" />
55+
<foreColor value="White" />
56+
</mapping>
57+
<mapping>
58+
<level value="DEBUG" />
59+
<foreColor value="Blue" />
60+
</mapping>
61+
<layout type="log4net.Layout.PatternLayout">
62+
<conversionPattern value="%date %-5level %logger - %message%newline"/>
63+
</layout>
64+
</appender>
65+
----
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
[#memoryappender]
19+
= MemoryAppender
20+
21+
It is unlikely that the `MemoryAppender` will be configured using a config file, but if you want to do it here's how.
22+
23+
[source,xml]
24+
----
25+
<appender name="MemoryAppender" type="log4net.Appender.MemoryAppender">
26+
<fix value="Partial" />
27+
</appender>
28+
----
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
[#outputdebugstringappender]
19+
= OutputDebugStringAppender
20+
21+
The following example shows how to configure the `OutputDebugStringAppender` to write logging messages to the `OutputDebugString` API.
22+
23+
[source,xml]
24+
----
25+
<appender name="OutputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender" >
26+
<layout type="log4net.Layout.PatternLayout">
27+
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
28+
</layout>
29+
</appender>
30+
----

0 commit comments

Comments
 (0)