Skip to content

Commit 085d268

Browse files
committed
added localsyslogappender doc
revised appender descriptions
1 parent 4db619c commit 085d268

20 files changed

+140
-31
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
**** xref:manual/configuration/fileappender.adoc[]
3030
**** xref:manual/configuration/rollingfileappender.adoc[]
3131
**** xref:manual/configuration/forwardingappender.adoc[]
32+
**** xref:manual/configuration/localsyslogappender.adoc[]
3233
**** xref:manual/configuration/managedcoloredconsoleappender.adoc[]
3334
**** xref:manual/configuration/memoryappender.adoc[]
3435
**** xref:manual/configuration/outputdebugstringappender.adoc[]

src/site/antora/modules/ROOT/pages/manual/appenders.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ log4net ships with the following appenders
4848
|AspNetTraceAppender
4949
|Writes logging events to the ASP trace context. These can then be rendered at the end of the ASP page or on the ASP trace page.
5050
51+
|BufferingForwardingAppender
52+
|Buffers events and then forwards them to attached appenders.
53+
5154
|ColoredConsoleAppender
5255
|Writes color highlighted logging events to the application's Windows Console.
5356

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@
1818
[#adonetappender]
1919
= AdoNetAppender
2020
21-
The configuration of the AdoNetAppender depends on the provider selected for the target database.
21+
The `AdoNetAppender` is used to log events directly to a database table.
22+
It writes log events in batches (with a default size of 100, controlled by the `BufferSize` setting).
2223
23-
The following examples show how to configure the AdoNetAppender to log messages to different databases.
24-
The events are written in batches of 100 (BufferSize).
25-
The ConnectionType specifies the fully qualified type name for the System.Data.IDbConnection to use to connect to the database.
26-
The ConnectionString is database provider specific.
27-
The CommandText is either a prepared statement or a stored procedure, in this case it is a prepared statement.
28-
Each parameter to the prepared statement or stored procedure is specified with its name, database type and a layout that renders the value for the parameter.
24+
The configuration of `AdoNetAppender` depends on the database provider you're using.
25+
Here are the key configuration elements:
26+
27+
* `ConnectionType`: Specifies the fully qualified type name for the `System.Data.IDbConnection` used to connect to the database.
28+
* `ConnectionString`: The connection string that is specific to the database provider (e.g., SQL Server, MySQL).
29+
* `CommandText`: Defines the SQL command to execute. This can either be a prepared statement or a stored procedure. In the examples below, a prepared statement is used.
30+
31+
Each parameter in the prepared statement or stored procedure is defined with:
32+
33+
* `Name`: The name of the parameter.
34+
* `DbType`: The database type for the parameter.
35+
* `Layout`: The layout used to render the value for the parameter.
36+
37+
The following examples illustrate how to configure the `AdoNetAppender` for different databases.
2938
3039
[#mssqlserver]
3140
== MS SQL Server
@@ -273,8 +282,8 @@ The appender configuration is:
273282
[#other-databases]
274283
== Other databases
275284
276-
You can adjust the provided examples to other databases by
285+
To adapt the provided examples for use with other databases, follow these steps:
277286
278-
* find a nuget package for connecting via ado.net
279-
* adjust the create table script (tweaking the used data types)
280-
* adjust the connectionType-Property in AdoNetAppender config to the connection type from the nuget package
287+
* Find a NuGet package that provides the necessary ADO.NET provider for your database.
288+
* Modify the `CREATE TABLE` script to match the data types used by your database.
289+
* Update the `ConnectionType` property in the `AdoNetAppender` configuration to reference the connection type from the selected NuGet package.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
[#bufferingforwardingappender]
1919
= BufferingForwardingAppender
2020
21+
The `BufferingForwardingAppender` buffers log events in memory before forwarding them to another appender.
22+
This helps improve performance by reducing the number of writes to the destination appender, especially in high-volume logging scenarios.
23+
Once the buffer reaches a specified size or time threshold, the events are forwarded to the target appender in a batch.
24+
2125
The following example shows how to configure the `BufferingForwardingAppender` to buffer 100 messages before delivering them to the `ConsoleAppender`.
2226
2327
[source,xml]

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
[#coloredconsoleappender]
1919
= ColoredConsoleAppender
2020
21+
The `ColoredConsoleAppender` writes log messages to the console with color coding based on log levels.
22+
It allows configurable colors for each log level, making it easier to identify log severity.
23+
2124
The following example shows how to configure the ColoredConsoleAppender to log messages to the console.
22-
By default the messages are sent to the console standard output stream.
2325
This example shows how to highlight error messages.
2426
2527
[source,xml]

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
[#consoleappender]
1919
= ConsoleAppender
2020
21+
The `ConsoleAppender` writes log messages to the console.
22+
It outputs messages without color coding, making it simple and suitable for basic logging needs.
23+
2124
The following example shows how to configure the `ConsoleAppender` to log messages to the console.
2225
By default the messages are sent to the console standard output stream.
2326

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
[#eventlogappender]
1919
= EventLogAppender
2020
21+
The EventLogAppender in log4net logs messages to the Windows Event Log.
22+
It is limited to .Net 4.x because it is Windows specific and .netstandard lacks support for writing to the Event Log.
23+
2124
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.
2225
2326
[source,xml]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ These examples are by no means exhaustive configurations for the appenders.
3030
* xref:manual/configuration/fileappender.adoc[]
3131
* xref:manual/configuration/rollingfileappender.adoc[]
3232
* xref:manual/configuration/forwardingappender.adoc[]
33+
* xref:manual/configuration/localsyslogappender.adoc[]
3334
* xref:manual/configuration/managedcoloredconsoleappender.adoc[]
3435
* xref:manual/configuration/memoryappender.adoc[]
3536
* xref:manual/configuration/outputdebugstringappender.adoc[]

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@
1818
[#fileappender]
1919
= FileAppender
2020
21+
The `FileAppender` writes log messages to a specified file.
22+
It can append to existing files or overwrite them, depending on the configuration.
23+
2124
The following example shows how to configure the `FileAppender` to write messages to a file.
22-
The file specified is log-file.txt.
25+
The file specified is MyApp.log.
2326
The file will be appended to rather than overwritten each time the logging process starts.
2427
2528
[source,xml]
2629
----
2730
<appender name="FileAppender" type="log4net.Appender.FileAppender">
28-
<file value="log-file.txt" />
31+
<file value="MyApp.log" />
2932
<appendToFile value="true" />
3033
<layout type="log4net.Layout.PatternLayout">
3134
<conversionPattern value="%date [%thread] %-5level %logger - %message%newline" />
@@ -39,7 +42,7 @@ The encoding to use to write to the file is also specified.
3942
[source,xml]
4043
----
4144
<appender name="FileAppender" type="log4net.Appender.FileAppender">
42-
<file value="${TEMP}/log-file.txt" />
45+
<file value="${TEMP}/MyApp.log" />
4346
<appendToFile value="true" />
4447
<encoding value="unicodeFFFE" />
4548
<layout type="log4net.Layout.PatternLayout">
@@ -53,7 +56,7 @@ This example shows how to configure the appender to use the minimal locking mode
5356
[source,xml]
5457
----
5558
<appender name="FileAppender" type="log4net.Appender.FileAppender">
56-
<file value="log-file.txt" />
59+
<file value="MyApp.log" />
5760
<appendToFile value="true" />
5861
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
5962
<layout type="log4net.Layout.PatternLayout">

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
[#forwardingappender]
1919
= ForwardingAppender
2020
21+
The `ForwardingAppender` forwards log messages to another appender.
22+
This appender is used only in special circumstances.
23+
2124
The following example shows how to configure the `ForwardingAppender`.
2225
The forwarding appender allows a set of constraints to be used to decorate an appender.
2326
2427
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.
2528
26-
This appender is used only in special circumstances.
27-
2829
[source,xml]
2930
----
3031
<appender name="ForwardingAppender" type="log4net.Appender.ForwardingAppender" >

0 commit comments

Comments
 (0)