Serilog.Sinks.Debug 3.0.0-dev-00040

Serilog.Sinks.Debug Build status NuGet Version Documentation Join the chat at https://gitter.im/serilog/serilog Help

A Serilog sink that writes log events to the Visual Studio debug output window.

Getting started

To use the sink, first install the NuGet package:

Install-Package Serilog.Sinks.Debug

Then enable the sink using WriteTo.Debug():

Log.Logger = new LoggerConfiguration()
    .WriteTo.Debug()
    .CreateLogger();
    
Log.Information("Hello, world!");

Log events will be printed to the debug output:

Debug Output

XML <appSettings> configuration

To use the sink with the Serilog.Settings.AppSettings package, first install that package if you haven't already done so:

Install-Package Serilog.Settings.AppSettings

Instead of configuring the logger in code, call ReadFrom.AppSettings():

var log = new LoggerConfiguration()
    .ReadFrom.AppSettings()
    .CreateLogger();

In your application's App.config or Web.config file, specify the console sink assembly under the <appSettings> node:

<configuration>
  <appSettings>
    <add key="serilog:using:Debug" value="Serilog.Sinks.Debug" />
    <add key="serilog:write-to:Debug" />

JSON appsettings.json configuration

To use the console sink with Microsoft.Extensions.Configuration, for example with ASP.NET Core or .NET Core, use the Serilog.Settings.Configuration package. First install that package if you have not already done so:

Install-Package Serilog.Settings.Configuration

Instead of configuring the sink directly in code, call ReadFrom.Configuration():

var configuration = new ConfigurationBuilder()
    .AddJsonFile("appsettings.json")
    .Build();

var logger = new LoggerConfiguration()
    .ReadFrom.Configuration(configuration)
    .CreateLogger();

In your appsettings.json file, under the Serilog node, :

{
  "Serilog": {
    "WriteTo": ["Debug"]
  }
}

Copyright © 2017 Serilog Contributors - Provided under the Apache License, Version 2.0.

Showing the top 20 packages that depend on Serilog.Sinks.Debug.

Packages Downloads
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
126
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
127
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
129
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
130
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
131
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
132
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
134
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
154
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
186
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
237
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
260
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
331
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
396
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
745
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
128
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
130
Serilog.AspNetCore.Plus
Serilog support for ASP.NET Core logging with some plus features
222

.NET Framework 4.6.2

.NET Framework 4.7.1

.NET 6.0

.NET 8.0

.NET Standard 2.0

Version Downloads Last updated
3.0.0 296 07/22/2024
3.0.0-dev-00040 122 07/22/2024
2.0.0 343 02/04/2024
2.0.0-dev-00026 107 07/22/2024
1.0.2-dev-00023 99 07/22/2024
1.0.2-dev-00020 103 07/22/2024
1.0.2-dev-00018 93 07/22/2024
1.0.1 117 07/22/2024
1.0.1-dev-00015 114 07/22/2024
1.0.0 106 07/22/2024
1.0.0-dev-00009 109 07/22/2024
1.0.0-dev-00007 100 07/22/2024
1.0.0-dev-00004 97 07/22/2024
1.0.0-dev-00002 107 07/22/2024