You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This package is used in conjunction with _SerilogWeb.Classic_ to support
8
-
logging WebAPI exceptions with [Serilog](http://serilog.net).
7
+
_This package is designed for full framework ASP.NET applications. For ASP.NET Core, have a look at [Serilog.AspNetCore](https://github.com/serilog/serilog-aspnetcore)_
9
8
9
+
This package is used in conjunction with _SerilogWeb.Classic_ and adds :
10
+
- support for logging WebAPI exceptions with [Serilog](http://serilog.net)
11
+
- Web API specific enrichers
10
12
13
+
## Enrichers
14
+
The following enrichers are available in the `SerilogWeb.Classic.WebApi.Enrichers` namespace:
15
+
-**WebApiActionNameEnricher** : adds a property `WebApiAction` containing the name of the *Action* being executed in the *Web API Controller*
16
+
-**WebApiControllerNameEnricher** : adds a property `WebApiController` containing the name of the *Controller* in which a *Web API Action* has executed
17
+
-**WebApiRouteDataEnricher** : adds a property `WebApiRouteData` containing the dictionary of the *RouteData*
18
+
-**WebApiRouteTemplateEnricher** : adds a property `WebApiRouteTemplate` containing the *route template* selected by Web API routing
11
19
20
+
21
+
Usage :
22
+
23
+
```csharp
24
+
varlog=newLoggerConfiguration()
25
+
.WriteTo.Console()
26
+
.Enrich.With<WebApiRouteTemplateEnricher>()
27
+
.Enrich.With<WebApiActionNameEnricher>()
28
+
.CreateLogger();
29
+
```
30
+
31
+
To override the property name of the added property:
0 commit comments