From 0bdcd677b231b59c2d2a47b5b2cbc15de89d6ed4 Mon Sep 17 00:00:00 2001 From: "Jonas Merkle [JJM]" Date: Sat, 25 Apr 2020 15:10:19 +0200 Subject: [PATCH 1/4] nuget pkg update in tests --- .../Serilog.Sinks.SlackWebHook.Tests.csproj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj index 7f2214c..1117bee 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj @@ -24,8 +24,11 @@ - - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From 9931c8430f1c0b0eb42465ad0f1b3e24f33901fd Mon Sep 17 00:00:00 2001 From: "Jonas Merkle [JJM]" Date: Sat, 25 Apr 2020 21:30:45 +0200 Subject: [PATCH 2/4] new version --- .../Serilog.Sinks.SlackWebHook.Example.csproj | 2 +- .../Serilog.Sinks.SlackWebHook.Tests.csproj | 10 +--------- .../Serilog.Sinks.SlackWebHook.csproj | 4 +--- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Example/Serilog.Sinks.SlackWebHook.Example.csproj b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Example/Serilog.Sinks.SlackWebHook.Example.csproj index 9a5a280..caf8e48 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Example/Serilog.Sinks.SlackWebHook.Example.csproj +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Example/Serilog.Sinks.SlackWebHook.Example.csproj @@ -11,9 +11,9 @@ GitHub serilog, serilog-sink, slack, logging, csharp, example https://github.com/jonas-merkle/serilog-sinks-slackwebhook - 1.0.0.0 Serilog.Sinks.SlackWebHook.Example Serilog.Sinks.SlackWebHook.Example + 1.0.4 diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj index 1117bee..f9a42b4 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.Tests/Serilog.Sinks.SlackWebHook.Tests.csproj @@ -2,24 +2,16 @@ netcoreapp3.1 - false - Jonas Merkle [JJM] - Unit Tests for a basic Slack Sink for the Serilog framwork. - © by Jonas Merkle [JJM], 2020. - LICENSE.txt - https://github.com/jonas-merkle/serilog-sinks-slackwebhook - https://github.com/jonas-merkle/serilog-sinks-slackwebhook - GitHub - serilog, serilog-sink, slack, logging, csharp, unit-tests + 1.0.4 diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj index bb333a4..1dbb846 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj @@ -15,9 +15,7 @@ false Serilog.Sinks.SlackWebHook - 1.0.3.0 - 1.0.3.0 - 1.0.3 + 1.0.4 From affe14524e7259108b086a4502d92a9d9f05f4ff Mon Sep 17 00:00:00 2001 From: "Jonas Merkle [JJM]" Date: Tue, 28 Apr 2020 12:29:57 +0200 Subject: [PATCH 3/4] added support for netstandard2.0 --- .../Serilog.Sinks.SlackWebHook.csproj | 2 +- .../Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj index 1dbb846..0ddbd24 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook.csproj @@ -1,7 +1,7 @@ - netstandard2.1 + netstandard2.1;netstandard2.0; Jonas Merkle [JJM] LICENSE.txt GitHub diff --git a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs index 4c76eda..678225f 100644 --- a/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs +++ b/Serilog.Sinks.SlackWebHook/Serilog.Sinks.SlackWebHook/SlackSinkMessageTools.cs @@ -99,13 +99,13 @@ public static List GenerateSlackMessageAttachments(LogEvent log var stringWriter = new StringWriter(); // collect all log event information - foreach (var (key, value) in logEvent.Properties) + foreach (var property in logEvent.Properties) { - value.Render(stringWriter, formatProvider: formatProvider); + property.Value.Render(stringWriter, formatProvider: formatProvider); var field = new SlackField { Short = slackSinkOptions.SlackDisplayExtendedInfoAttachmentShort, - Title = key, + Title = property.Key, Value = stringWriter.ToString() }; infoFields.Add(field); From 693df3eedb9f56301ba51dd61d2fd2a705391200 Mon Sep 17 00:00:00 2001 From: "Jonas Merkle [JJM]" Date: Tue, 28 Apr 2020 12:34:47 +0200 Subject: [PATCH 4/4] Table Layout Fixed --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b065399..e85fdb6 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,16 @@ A basic Slack Sink for the Serilog framwork. ## Status -| | | -|----------------------:|-| -| Nuget Package Version | [![Nuget Version](https://img.shields.io/nuget/v/Serilog.Sinks.SlackWebHook?style=flat-square)](https://www.nuget.org/packages/Serilog.Sinks.SlackWebHook/) | -| nuget.org Deployment | [![nuget.org Deployment](https://img.shields.io/azure-devops/release/jonas-merkle/09454b63-c969-4591-aa24-ea8867d031bd/1/2?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_release?view=all&_a=releases&definitionId=1) -| Build Status Master | [![Build Status Master](https://img.shields.io/azure-devops/build/jonas-merkle/serilog-sinks-slackwebhook/3/master?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_build/latest?definitionId=3) | -| Build Status Develop | [![Build status Develop](https://img.shields.io/azure-devops/build/jonas-merkle/serilog-sinks-slackwebhook/4/develop?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_build/latest?definitionId=4) | +| | | +|----------------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Nuget Package Version | [![Nuget Version](https://img.shields.io/nuget/v/Serilog.Sinks.SlackWebHook?style=flat-square)](https://www.nuget.org/packages/Serilog.Sinks.SlackWebHook/) | +| nuget.org Deployment | [![nuget.org Deployment](https://img.shields.io/azure-devops/release/jonas-merkle/09454b63-c969-4591-aa24-ea8867d031bd/1/2?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_release?view=all&_a=releases&definitionId=1) | +| Build Status Master | [![Build Status Master](https://img.shields.io/azure-devops/build/jonas-merkle/serilog-sinks-slackwebhook/3/master?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_build/latest?definitionId=3) | +| Build Status Develop | [![Build status Develop](https://img.shields.io/azure-devops/build/jonas-merkle/serilog-sinks-slackwebhook/4/develop?style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_build/latest?definitionId=4) | | Test Status Master | [![Test Status Master](https://img.shields.io/azure-devops/tests/jonas-merkle/serilog-sinks-slackwebhook/3?compact_message&style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_test/analytics?definitionId=3&contextType=build) | | Test Status Develop | [![Test Status Master](https://img.shields.io/azure-devops/tests/jonas-merkle/serilog-sinks-slackwebhook/4?compact_message&style=flat-square)](https://dev.azure.com/jonas-merkle/serilog-sinks-slackwebhook/_test/analytics?definitionId=4&contextType=build) | -| Sonar Code Quality | [![Sonar Code Quality](https://img.shields.io/sonar/quality_gate/jonas-merkle_serilog-sinks-slackwebhook?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=jonas-merkle_serilog-sinks-slackwebhook) | -| Maintenance Status | [![Sonar Code Quality](https://img.shields.io/maintenance/yes/2020?style=flat-square)]() | +| Sonar Code Quality | [![Sonar Code Quality](https://img.shields.io/sonar/quality_gate/jonas-merkle_serilog-sinks-slackwebhook?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=jonas-merkle_serilog-sinks-slackwebhook) | +| Maintenance Status | [![Sonar Code Quality](https://img.shields.io/maintenance/yes/2020?style=flat-square)]() | ## 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](https://github.com/mrb0nj/Slack.Webhooks) project to handle the communication with Slack. Therfor you need a vaild WebHook URL to use this Sink. To get such a WebHook URL please read this [article](https://slack.com/help/articles/115005265063-Incoming-Webhooks-for-Slack). The log messages will be send in batches to the slack servers. You can setup the batch size to fit your needs. @@ -20,12 +20,12 @@ This tool provides a Serilog Sink which sends log messages to one or more channe You can get the latest version of this software as a nuget package form [nuget.org](https://www.nuget.org/packages/Serilog.Sinks.SlackWebHook/) ### Installing the Nuget Package -| Tool | Command/Code | -|------|--------------| -|Package Manager | ```PM> Install-Package Serilog.Sinks.SlackWebHook -Version X.Y.Z``` | -|.NET CLI | ```> dotnet add package Serilog.Sinks.SlackWebHook --version X.Y.Z```| +| Tool | Command/Code | +|------------------|--------------------------------------------------------------------------------| +|Package Manager | ```PM> Install-Package Serilog.Sinks.SlackWebHook -Version X.Y.Z``` | +|.NET CLI | ```> dotnet add package Serilog.Sinks.SlackWebHook --version X.Y.Z``` | | PackageReference | ``````| -| Package CLI | ```> paket add Serilog.Sinks.SlackWebHook --version X.Y.Z```| +| Package CLI | ```> paket add Serilog.Sinks.SlackWebHook --version X.Y.Z``` | ## Dependencies