A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/serilog-web/classic-mvc below:

serilog-web/classic-mvc: [Discontinued] ASP.NET MVC support for SerilogWeb.Classic

SerilogWeb.Classic.Mvc

Deprecation notice: this package is no longer maintained. The world has moved on to ASP.NET Core. Take a look at Serilog.AspNetCore instead!

ASP.NET MVC support for SerilogWeb.Classic.

Package - SerilogWeb.Classic.Mvc | Platforms - .NET 4.5

This package is designed for full framework ASP.NET applications. For ASP.NET Core, have a look at Serilog.AspNetCore

This package is used in conjunction with SerilogWeb.Classic and adds ASP.NET MVC specific enrichers.

The following enrichers are available as extension methods from the LoggerConfiguration.Enrich API:

Usage :

var log = new LoggerConfiguration()
    .WriteTo.Console()
    .Enrich.WithMvcRouteTemplate()
    .Enrich.WithMvcActionName()
    .CreateLogger();

To override the property name of the added property:

var log = new LoggerConfiguration()
    .WriteTo.Console()
    .Enrich.WithMvcRouteTemplate("RouteTemplate")
    .CreateLogger();

Enrichers can also be defined in a configuration file by using Serilog.Settings.AppSettings as follows:

<appSettings>
    <add key="serilog:using:SerilogWeb.Classic.Mvc" value="SerilogWeb.Classic.Mvc"/>
    <add key="serilog:enrich:WithMvcActionName"/>
    <add key="serilog:enrich:WithMvcControllerName"/>
    <add key="serilog:enrich:WithMvcRouteData"/>
    <add key="serilog:enrich:WithMvcRouteTemplate"/>
</appSettings>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4