serilog-sinks-slack icon indicating copy to clipboard operation
serilog-sinks-slack copied to clipboard

Feature Request: Filtering Logs based on Properties

Open himanshusaini111 opened this issue 9 months ago • 1 comments

I have two Slack Sinks that log to different Channels.

One Channel is for logs and the other is for alerts. Like below:

.WriteTo.Slack( webhookUrl: "https://hooks.slack.com/services/hook1", //hook for alerting CST customChannel: "aletr", customUsername: $"alert-bot", customIcon: ":radioactive_sign:", restrictedToMinimumLevel: LogEventLevel.Fatal ) .WriteTo.Slack( webhookUrl: "https://hooks.slack.com/services/hook2", customChannel: "logs", customUsername: $"log-bot", customIcon: ":radioactive_sign:", restrictedToMinimumLevel: LogEventLevel.Error );

Currently I am managing this by making the alert Channels log level as Fatal. But I wan to log Certain Errors as Alerts.

But I cant do that directly as then I will have decrease the logLevel for Alert Channel and it will be polluted by all the Error Logs

himanshusaini111 avatar May 17 '24 13:05 himanshusaini111