A logging service that redacts all logs
Features
- Redacts all logs
- Allows for dictionary of variables to be past in that all become first class propertys in the log.
- Ability to add a correlation id that works though async in straight forward fashion
- Allows for improved testability
var data = new Dictionary<string, object>
{
{ "Username", "DemoUser" },
{ "Password",
@"{
""Password"": ""password""
}"
}
};
var message = "Generic Log Message";
var exception = new Exception("Error");
loggingService.LogDebugRedacted(message);
loggingService.LogDebugRedacted(message, data);
loggingService.LogInformationRedacted(message);
loggingService.LogInformationRedacted(message, data);
loggingService.LogWarningRedacted(message);
loggingService.LogWarningRedacted(message, data);
loggingService.LogErrorRedacted(message, exception);
loggingService.LogErrorRedacted(message, exception, data);
dbug: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
dbug: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
Username: DemoUser
Password: {
"Password": "***REDACTED***"
}
info: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
info: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
Username: DemoUser
Password: {
"Password": "***REDACTED***"
}
warn: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
warn: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
Username: DemoUser
Password: {
"Password": "***REDACTED***"
}
fail: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
System.Exception: Error
fail: DickinsonBros.Logger.Runner.Program[1]
Generic Log Message
Username: DemoUser
Password: {
"Password": "***REDACTED***"
}