Skip to content

geeksarray/generate-log-using-serilog-and-seq-in-asp-net-core-mvc6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Generate Log using Serilog And Seq In ASP.NET Core MVC 6

This blog explains how to generate logs using Serilog, its feature like Sink, log level, JSONFormatter, Serilog Enricher, Output Templates, and analyze using Seq.

Serilog is a structured logging system that creates log messages and captures key attributes and data about the message's context. Serilog generates log messages as data, not just plain text. You can efficiently perform structured queries on these messages.

var _logger = new LoggerConfiguration()                        
    .WriteTo.File("./logs/log-.txt", 
        rollingInterval: RollingInterval.Day)       
    .WriteTo.Seq("http://localhost:5341", 
        Serilog.Events.LogEventLevel.Warning)
    .MinimumLevel.Debug()
    .CreateLogger();

builder.Logging.AddSerilog(_logger);
var app = builder.Build();

Seq

ASP.NET Core Serilog Seq

For more details Generate Log using Serilog And Seq In ASP.NET Core MVC 6

About

Serilog is a structured logging system that creates log messages and captures key attributes and data about the message's context. Serilog generates log messages as data, not just plain text. You can efficiently perform structured queries on these messages.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors