Skip to content

Commit 559e7e3

Browse files
authored
update readme
1 parent 55ea14c commit 559e7e3

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
11
# SeriLog.LogSanitizingFormatter
2+
3+
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()
28+
{
29+
return new LoggerConfiguration()
30+
.Enrich.WithExceptionDetails()
31+
.MinimumLevel.Verbose()
32+
.WriteTo.Console(new JsonLogSanitizingFormatter(new JsonFormatter(), true))
33+
.CreateLogger();
34+
}
35+
}
36+
}
37+
```
38+
39+
### Running test locally
40+
41+
### Custodian
42+
43+
Primary custodian: [@terencet](https://github.com/terencet) <br />
44+
Other Custodians: [@stu-mck](https://github.com/stu-mck)

0 commit comments

Comments
 (0)