Serilog.Sinks.SlackWebHook 1.2.0

A basic Slack Sink for the Serilog framwork.

Install-Package Serilog.Sinks.SlackWebHook -Version 1.2.0
dotnet add package Serilog.Sinks.SlackWebHook --version 1.2.0
<PackageReference Include="Serilog.Sinks.SlackWebHook" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Serilog.Sinks.SlackWebHook --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Serilog.Sinks.SlackWebHook

A basic Slack Sink for the Serilog framework.

Status

| | |
|----------------------:|-----------------------|
| Nuget Package Version | Nuget Version |
| nuget.org Deployment | nuget.org Deployment |
| Build Status Master | Build Status Master |
| Build Status Develop | Build status Develop |
| Test Status Master | Test Status Master |
| Test Status Develop | Test Status Master |
| Sonar Code Quality | Sonar Code Quality |
| Maintenance Status | Sonar Code Quality |

Description

This tool provides a Serilog Sink which sends log messages to one or more channels in a Slack workspace. To send this messages this tool is using the Slack.Webhooks project to handle the communication with Slack. Therefor you need a valid WebHook URL to use this Sink. To get such a WebHook URL please read this article. The log messages will be send in batches to the slack servers. You can setup the batch size to fit your needs.

Nuget Package

You can get the latest version of this software as a nuget package form nuget.org

Installing the Nuget Package

| Tool | Command/Code |
|------------------|--------------|
|Package Manager | PM&gt; Install-Package Serilog.Sinks.SlackWebHook -Version X.Y.Z |
|.NET CLI | &gt; dotnet add package Serilog.Sinks.SlackWebHook --version X.Y.Z |
| PackageReference | &lt;PackageReference Include=&quot;Serilog.Sinks.SlackWebHook&quot; Version=&quot;X.Y.Z&quot; /&gt; |
| Package CLI | &gt; paket add Serilog.Sinks.SlackWebHook --version X.Y.Z |

Dependencies

Serilog related

Slack related

Usage

a) Absolute basic usage:

Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Verbose()
            .WriteTo.Slack(
                slackWebHookUrl: "https://...",
                slackChannel: null
            )
            .CreateLogger();

b) Recommended usage:

var logLevelSwitch = new LoggingLevelSwitch(initialMinimumLevel: LogEventLevel.Verbose);
Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Verbose()
                .WriteTo.Slack(
                    slackWebHookUrl: "https://...",
                    slackChannel: "log-output-channel",
                    slackUsername: "Serilog Slack Sink Bot",
                    slackEmojiIcon: ":monkey_face:",

                    periodicBatchingSinkOptionsBatchSizeLimit: 1,
                    periodicBatchingSinkOptionsPeriod: TimeSpan.FromMilliseconds(1000),
                    periodicBatchingSinkOptionsQueueLimit: 10000,

                    sinkRestrictedToMinimumLevel: LogEventLevel.Verbose,
                    sinkLevelSwitch:logLevelSwitch
                )
                .CreateLogger();

c) Advanced usage (all available option exposed):

Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Verbose()
                .WriteTo.Slack(
                    slackWebHookUrl: "https://...",
                    slackUsername: null,
                    slackEmojiIcon: null,
                    slackUriIcon: null,
                    slackChannels: null,
                    slackDeleteOriginal: null,
                    slackLinkNames: null,
                    slackMarkdown: null,
                    slackParseObj: null,
                    slackReplaceOriginal: null,
                    slackResponseType: null,
                    slackThreadId: null,
                    slackAttachmentColorsObj: null,
                    slackAttachmentFooterIconObj: null,
                    slackAddShortInfoAttachment: null,
                    slackDisplayShortInfoAttachmentShort: null,
                    slackAddExtendedInfoAttachment: null,
                    slackDisplayExtendedInfoAttachmentShort: null,
                    slackAddExceptionAttachment: null,
                    slackDisplayExceptionAttachmentShort: null,
                    slackConnectionTimeout: null,
                    slackHttpClientObj: null,
                    generateSlackFunctions: null,
                    periodicBatchingSinkOptionsBatchSizeLimit: null,
                    periodicBatchingSinkOptionsPeriod: null,
                    periodicBatchingSinkOptionsQueueLimit: null,
                    sinkRestrictedToMinimumLevel: null,
                    sinkOutputTemplate: null,
                    sinkLevelSwitch: null,
                    sinkFormatProvider: null,
                    sinkActivationSwitch: null
                )
                .CreateLogger();

Serilog.Sinks.SlackWebHook

A basic Slack Sink for the Serilog framework.

Status

| | |
|----------------------:|-----------------------|
| Nuget Package Version | Nuget Version |
| nuget.org Deployment | nuget.org Deployment |
| Build Status Master | Build Status Master |
| Build Status Develop | Build status Develop |
| Test Status Master | Test Status Master |
| Test Status Develop | Test Status Master |
| Sonar Code Quality | Sonar Code Quality |
| Maintenance Status | Sonar Code Quality |

Description

This tool provides a Serilog Sink which sends log messages to one or more channels in a Slack workspace. To send this messages this tool is using the Slack.Webhooks project to handle the communication with Slack. Therefor you need a valid WebHook URL to use this Sink. To get such a WebHook URL please read this article. The log messages will be send in batches to the slack servers. You can setup the batch size to fit your needs.

Nuget Package

You can get the latest version of this software as a nuget package form nuget.org

Installing the Nuget Package

| Tool | Command/Code |
|------------------|--------------|
|Package Manager | PM&gt; Install-Package Serilog.Sinks.SlackWebHook -Version X.Y.Z |
|.NET CLI | &gt; dotnet add package Serilog.Sinks.SlackWebHook --version X.Y.Z |
| PackageReference | &lt;PackageReference Include=&quot;Serilog.Sinks.SlackWebHook&quot; Version=&quot;X.Y.Z&quot; /&gt; |
| Package CLI | &gt; paket add Serilog.Sinks.SlackWebHook --version X.Y.Z |

Dependencies

Serilog related

Slack related

Usage

a) Absolute basic usage:

Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Verbose()
            .WriteTo.Slack(
                slackWebHookUrl: "https://...",
                slackChannel: null
            )
            .CreateLogger();

b) Recommended usage:

var logLevelSwitch = new LoggingLevelSwitch(initialMinimumLevel: LogEventLevel.Verbose);
Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Verbose()
                .WriteTo.Slack(
                    slackWebHookUrl: "https://...",
                    slackChannel: "log-output-channel",
                    slackUsername: "Serilog Slack Sink Bot",
                    slackEmojiIcon: ":monkey_face:",

                    periodicBatchingSinkOptionsBatchSizeLimit: 1,
                    periodicBatchingSinkOptionsPeriod: TimeSpan.FromMilliseconds(1000),
                    periodicBatchingSinkOptionsQueueLimit: 10000,

                    sinkRestrictedToMinimumLevel: LogEventLevel.Verbose,
                    sinkLevelSwitch:logLevelSwitch
                )
                .CreateLogger();

c) Advanced usage (all available option exposed):

Log.Logger = new LoggerConfiguration()
                .MinimumLevel.Verbose()
                .WriteTo.Slack(
                    slackWebHookUrl: "https://...",
                    slackUsername: null,
                    slackEmojiIcon: null,
                    slackUriIcon: null,
                    slackChannels: null,
                    slackDeleteOriginal: null,
                    slackLinkNames: null,
                    slackMarkdown: null,
                    slackParseObj: null,
                    slackReplaceOriginal: null,
                    slackResponseType: null,
                    slackThreadId: null,
                    slackAttachmentColorsObj: null,
                    slackAttachmentFooterIconObj: null,
                    slackAddShortInfoAttachment: null,
                    slackDisplayShortInfoAttachmentShort: null,
                    slackAddExtendedInfoAttachment: null,
                    slackDisplayExtendedInfoAttachmentShort: null,
                    slackAddExceptionAttachment: null,
                    slackDisplayExceptionAttachmentShort: null,
                    slackConnectionTimeout: null,
                    slackHttpClientObj: null,
                    generateSlackFunctions: null,
                    periodicBatchingSinkOptionsBatchSizeLimit: null,
                    periodicBatchingSinkOptionsPeriod: null,
                    periodicBatchingSinkOptionsQueueLimit: null,
                    sinkRestrictedToMinimumLevel: null,
                    sinkOutputTemplate: null,
                    sinkLevelSwitch: null,
                    sinkFormatProvider: null,
                    sinkActivationSwitch: null
                )
                .CreateLogger();

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.0 75 11/16/2020
1.1.0 48 11/10/2020
1.0.4 955 4/28/2020
1.0.3 109 4/24/2020
1.0.2 109 4/22/2020
1.0.1 113 4/22/2020
1.0.0 114 4/20/2020