To use the Exceptionless sink, first install the NuGet package:
Install-Package Serilog.Sinks.ExceptionlessNext, 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
ExceptionlessClientinstance you can provide an API Key orExceptionlessClientinstance toWriteTo.Exceptionless().
using Exceptionless;
ExceptionlessClient.Default.Startup("API_KEY");Next, enable the sink using WriteTo.Exceptionless()
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.
using var _ = _logger.BeginScope(new Dictionary<string, object> { ["Tags"] = new string[] { "Tag1", "Tag2" }});
_logger.Log(logLevel, eventId, state, exception, formatter);Exceptionless events are queued in memory and submitted to the API in the background. If your application process crashes or exits, pending logs may be lost. You should always ensure that you flush the Serilog sink when shutting down:
await Log.CloseAndFlushAsync(); // Recommended for modern async apps
// or
Log.CloseAndFlush();Copyright © 2026 Serilog Contributors - Provided under the Apache License, Version 2.0.