https://github.com/exceptionless/serilog-sinks-exceptionless
Writes events from Serilog to the Exceptionless logging service.
https://github.com/exceptionless/serilog-sinks-exceptionless
Last synced: 10 months ago
JSON representation
Writes events from Serilog to the Exceptionless logging service.
- Host: GitHub
- URL: https://github.com/exceptionless/serilog-sinks-exceptionless
- Owner: exceptionless
- License: apache-2.0
- Created: 2015-03-30T21:51:48.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T23:55:21.000Z (over 1 year ago)
- Last Synced: 2025-04-09T21:17:13.383Z (10 months ago)
- Language: C#
- Size: 140 KB
- Stars: 32
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Serilog.Sinks.Exceptionless
[](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[](https://www.nuget.org/packages/Serilog.Sinks.Exceptionless/)
## Getting started
To use the Exceptionless sink, first install the [NuGet package](https://www.nuget.org/packages/Serilog.Sinks.Exceptionless/):
```powershell
Install-Package Serilog.Sinks.Exceptionless
```
Next, we need to ensure that Exceptionless is configured with an API Key. If you are
already using Exceptionless you can skip this step.
The Exceptionless sink will use the default `ExceptionlessClient` client instance. This ensures
that all of your Exceptionless configuration is shared with the sink and also enables logging
of unhandled exceptions to Exceptionless.
> For advanced users who wish to configure the sink to use custom `ExceptionlessClient` instance
> you can provide an API Key or `ExceptionlessClient` instance to `WriteTo.Exceptionless()`.
```csharp
using Exceptionless;
ExceptionlessClient.Default.Startup("API_KEY");
```
Next, enable the sink using `WriteTo.Exceptionless()`
```csharp
Log.Logger = new LoggerConfiguration()
.WriteTo.Exceptionless(b => b.AddTags("Serilog Example"))
.CreateLogger();
```
To get tags to populate on the exceptionless UI, add a `Tags` string enumerable to any log.
```csharp
using var _ = _logger.BeginScope(new Dictionary { ["Tags"] = new string[] { "Tag1", "Tag2" }});
_logger.Log(logLevel, eventId, state, exception, formatter);
```
* [Documentation](https://github.com/serilog/serilog/wiki)
Copyright © 2023 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html).