Comments (1)
I am of the opinion that this is not the right way to achieve what you're looking for, and is beyond the scope and intents of this sink.
I believe that Serilog.Expressions might be what you're looking for in order to accomplish this.
Amongst other ways, I think you could use the EventId as a selector. Consider the following configuration:
"WriteTo": [
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{
"Name": "ByIncludingOnly",
"Args": {
"expression": "EventId.Id = 1"
}
}],
"WriteTo": [
{
"Name": "Slack",
"Args": {
"webHookUrl": "..."
}
}]
}
}
},
{
"Name": "Logger",
"Args": {
"configureLogger": {
"Filter": [
{
"Name": "ByIncludingOnly",
"Args": {
"expression": "EventId.Id = 2"
}
}],
"WriteTo": [
{
"Name": "Slack",
"Args": {
"webHookUrl": "..."
}
}]
}
}
}]
It's a bit bulky and repetitive but it does get the job done. As for usage, it goes something like this:
logger.LogWarning(1, "...");
from serilog-sinks-slack.
Related Issues (20)
- Stacktrace field with too long message causes incorrect display HOT 2
- Sign the Assembly with a Strong Name
- usage with Serilog.Settings.Configuration HOT 3
- Add support for outputTemplate message formatting HOT 2
- Slack webhook only working in dotnet core HOT 1
- Sink not writing to Slack HOT 7
- Support custom timestamp attachment format
- Missing license file HOT 1
- Can we show Event properties fullscreen? HOT 3
- MinimumLogEventLevel is ignored HOT 4
- Add Serilog Sink icon to Serilog.Sinks.Slack NuGet package HOT 1
- Application exit before slack log is "slacked" HOT 1
- Expose QueueLimit configuration option
- Publish to NuGet fails HOT 5
- Sink not working in .NET Framework 4.5.2 HOT 1
- Enhancement: Allow option to add custom attachments
- Allow one channel per log level HOT 1
- Upgrading to the latest version of Serilog causes infinite loop HOT 5
- Stack Overflow when using a newer version of Serilog.Sinks.PeriodicBatching
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serilog-sinks-slack.