Skip to content

Commit 20e8e19

Browse files
committed
BufferingForwardingAppender documented
1 parent c23c890 commit 20e8e19

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
** xref:manual/configuration.adoc[]
2323
*** xref:manual/configuration/examples.adoc[]
2424
**** xref:manual/configuration/adonetappender.adoc[]
25+
**** xref:manual/configuration/bufferingforwardingappender.adoc[]
2526
** xref:manual/examples.adoc[]
2627
** xref:manual/filters.adoc[]
2728
** xref:manual/layouts.adoc[]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
[#bufferingforwardingappender]
19+
= BufferingForwardingAppender
20+
21+
The following example shows how to configure the BufferingForwardingAppender to buffer 100 messages before delivering them to the ConsoleAppender.
22+
23+
[source,xml]
24+
----
25+
<appender name="BufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
26+
<bufferSize value="100"/>
27+
<!--
28+
The value configures what gets fixed immediately when calling logger.Log().
29+
The default value is All, which may negatively impact performance enough to warrant changing it to fix less data.
30+
More information can be found at https://github.com/apache/logging-log4net/blob/master/src/log4net/Core/FixFlags.cs
31+
-->
32+
<fix value="All"/>
33+
<appender-ref ref="ConsoleAppender" />
34+
</appender>
35+
----
36+
37+
This example shows how to deliver only significant events.
38+
39+
A LevelEvaluator is specified with a threshold of WARN.
40+
This means that the events will only be delivered when a message with level of WARN or higher level is logged.
41+
42+
Up to 512 (BufferSize) previous messages of any level will also be delivered to provide context information.
43+
Messages not sent will be discarded.
44+
45+
[source,xml]
46+
----
47+
<appender name="BufferingForwardingAppender" type="log4net.Appender.BufferingForwardingAppender" >
48+
<bufferSize value="512" />
49+
<lossy value="true" />
50+
<evaluator type="log4net.Core.LevelEvaluator">
51+
<threshold value="WARN"/>
52+
</evaluator>
53+
<appender-ref ref="ConsoleAppender" />
54+
</appender>
55+
----

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ This document presents example configurations for the built-in appenders. These
2222
2323
These examples are by no means exhaustive configurations for the appenders.
2424
25-
* xref:manual/examples/adonetappender.adoc[AdoNetAppender]
25+
* xref:manual/configuration/adonetappender.adoc[]
26+
* xref:manual/configuration/bufferingforwardingappender.adoc[]

0 commit comments

Comments
 (0)