-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
I have Serilog slack configuration in appsettings.json:
{
"Name": "Slack",
"Args": {
"WebHookUrl": "https://hooks.slack.com/services/xxxx/xxxxx/xxxxxxx",
"CustomChannel": "#dev-log",
"CustomUserName ": "Slack Logger",
"BatchSizeLimit": 20,
"QueueLimit": 1000,
"CustomIcon": ":ghost:",
"TimestampFormat": "o",
//"MinimumLogEventLevel": "Warning"
"restrictedToMinimumLevel": "Warning"
}
}
I need to change in runtime the CustomChannel because in my code depending of logic I should notify to different channels.
`
LogContext.PushProperty("Environment", environment.ToString());
LogContext.PushProperty("UserName", loggedUserName);
LogContext.PushProperty("ErrorUID", logException.ErrorUid.ToString());
LogContext.PushProperty("SecuritySessionID", sessionUid);
// *** HERE I NEED TO SET THE CustomChannel PROPERTY *** //
_logger.LogError(exception, $"An error with ID {errorUid} ocurred.");`
Any clue?
Metadata
Metadata
Assignees
Labels
No labels