Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narochno/narochno.serilog.slack
A batching Serilog sink for Slack.
https://github.com/narochno/narochno.serilog.slack
client netcore serilog slack
Last synced: 3 days ago
JSON representation
A batching Serilog sink for Slack.
- Host: GitHub
- URL: https://github.com/narochno/narochno.serilog.slack
- Owner: Narochno
- License: mit
- Created: 2016-12-20T00:48:49.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-09-25T12:42:17.000Z (about 4 years ago)
- Last Synced: 2024-11-12T17:51:33.019Z (4 days ago)
- Topics: client, netcore, serilog, slack
- Language: C#
- Size: 79.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Narochno.Serilog.Slack [![Build status](https://ci.appveyor.com/api/projects/status/eju2eoyum80at14p/branch/master?svg=true)](https://ci.appveyor.com/project/Narochno/narochno-serilog-slack/branch/master) [![NuGet](https://img.shields.io/nuget/v/Narochno.Serilog.Slack.svg)](https://www.nuget.org/packages/Narochno.Serilog.Slack/)
A batching Serilog sink for Slack, narochno. Each log message is sent as an attachment on the same message, with the log event properties rendered out as fields.
![Screenshot](screenshot.png)
## Example Usage
```csharp
var webHookUrl = "your webhook URL";
var services = new ServiceCollection();
services.AddSlack(new SlackConfig()
{
WebHookUrl = webHookUrl
});
var serviceProvider = services.BuildServiceProvider();
var slackClient = serviceProvider.GetRequiredService();Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.SlackBlocking(slackClient, LogEventLevel.Information)
.CreateLogger();Log.Information("Testing!");
```More on correct usage of DI and Serilog on `ASP.NET Core` can be found here.
https://nblumhardt.com/2020/09/serilog-inject-dependencies/See the Narochno.Slack project for more information.