An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Seq.Client.Log4Net [![Build status](https://ci.appveyor.com/api/projects/status/sxw4n1a6v9o7db2i?svg=true)](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.