https://github.com/datalust/seq-client-log4net
A log4net appender that writes events to Seq
https://github.com/datalust/seq-client-log4net
log4net log4net-appender seq
Last synced: 4 months ago
JSON representation
A log4net appender that writes events to Seq
- Host: GitHub
- URL: https://github.com/datalust/seq-client-log4net
- Owner: datalust
- License: apache-2.0
- Created: 2013-11-19T11:18:55.000Z (about 12 years ago)
- Default Branch: dev
- Last Pushed: 2025-02-11T22:28:19.000Z (about 1 year ago)
- Last Synced: 2025-10-03T08:34:39.820Z (4 months ago)
- Topics: log4net, log4net-appender, seq
- Language: C#
- Homepage: https://datalust.co/seq
- Size: 986 KB
- Stars: 27
- Watchers: 7
- Forks: 26
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Seq.Client.Log4Net [](https://ci.appveyor.com/project/datalust/seq-client-log4net)
An Apache log4net appender that writes events to Seq.
> [!IMPORTANT]
>
> Like much of the log4net ecosystem, Seq's support for log4net is in maintenance mode.
>
> Seq works best with richly-structured event data like that produced by [Serilog](https://serilog.net), [ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?tabs=aspnetcore2x) and [NLog](http://nlog-project.org). These libraries are actively developed and have up-to-date support for modern application requirements.
### Getting started
The Seq appender for log4net supports both .NET Framework 4.0+, and .NET Core via .NET Standard 2.0.
To install _Seq.Client.Log4Net_ from NuGet, at the Visual Studio Package Manager console, type:
```powershell
Install-Package Seq.Client.Log4Net
```
Then, add the appender to your log4net configuration:
```xml
```
Set the `serverUrl` value to the address of your Seq server. Set the `apiKey` value to your Seq API key, if required.
Finally, add a reference to the appender in the appropriate configuration section:
```xml
```
### Writing events
That's it! When you write log events to your log4net `ILogger`:
```csharp
log.InfoFormat("Hello, {0}, from log4net!", Environment.UserName);
```
They'll appear beautifully in Seq.
### Performance
By default, the appender is synchronous. This can lead to application slowdowns.
For acceptable production performance, we recommend the use of [_Log4Net.Async_](https://github.com/cjbhaines/Log4Net.Async)
and a buffer size of 100 or greater. See [this log4net configuration](https://github.com/datalust/seq-client-log4net/blob/dev/example/SeqLog4NetExample/App.config) for full configuation sample.
> **Note regarding NLog 4.0 and SLAB clients:**
>
> This repository originally included _Seq.Client.NLog_, targeting NLog 4.0, and _Seq.Client.Slab_,
> targeting Microsoft SLAB. The NLog client has been replaced with the much-improved
> [_NLog.Targets.Seq_](https://github.com/datalust/nlog-targets-seq), while the SLAB client is now
> deprecated with no replacement currently planned. Both of these projects can be viewed in the
> `deprecated-nlog-slab` branch.