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
The purpose of this package is to process and sanitize the logevent given a set of sanitizing rules.
4
+
5
+
### Getting Started
6
+
7
+
The package comes with a default processor and sanitizing rules out of the box. What the default processor and sanitizing formatter does is it extract the message template and exception details and scrub the content that contains payload or access_token.
8
+
9
+
Add the Serilog.LogSanitizingFormatter NuGet package to your project using the NuGet Package Manager or run the following command in the Package Console Window:
10
+
11
+
```
12
+
Install-Package SeriLog.LogSanitizingFormatter
13
+
```
14
+
15
+
When setting up your logger, add `.WriteTo.Console(new JsonLogSanitizingFormatter(new JsonFormatter(), true))` line ike so:
16
+
17
+
```
18
+
using Serilog;
19
+
using Serilog.Exceptions;
20
+
using Serilog.Formatting.Json;
21
+
using SeriLog.LogSanitizingFormatter;
22
+
23
+
namespace PageUp.JobSource.Infrastructure.Logging
24
+
{
25
+
public class Logger
26
+
{
27
+
public static Serilog.Core.Logger CreateSerilogLogger()
0 commit comments