Skip to content

Serilog.Sinks.MicrosoftTeams is a library to save logging information from Serilog to Microsoft Teams. The assembly was written and tested in .Net Framework 4.8 and .Net Standard 2.0.

License

Notifications You must be signed in to change notification settings

Appelg/Serilog.Sinks.MicrosoftTeams

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serilog.Sinks.MicrosoftTeams

Serilog.Sinks.MicrosoftTeams is a library to save logging information from Serilog to Microsoft Teams. The assembly was written and tested in NetCore 3.1, .Net Framework 4.8 and .Net Standard 2.0.

Build status GitHub issues GitHub forks GitHub stars License: MIT Nuget NuGet Downloads Known Vulnerabilities Gitter

Available for

  • NetFramework 4.6
  • NetFramework 4.6.2
  • NetFramework 4.7
  • NetFramework 4.7.2
  • NetFramework 4.8
  • NetStandard 2.0
  • NetStandard 2.1
  • NetCore 2.1
  • NetCore 3.1

Net Core and Net Framework latest and LTS versions

Basic usage:

You need to add an "Incoming Webhook" connector to your Teams channel and get it's URL. title is optional but can help your distinguish logs coming from different sources. Check https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/connectors/connectors-using.

var logger = new LoggerConfiguration()
	.WriteTo.MicrosoftTeams(webHookUri, title: title)
    .CreateLogger();

The project can be found on nuget.

Configuration options:

Parameter Meaning Example Default value
webHookUri The Microsoft teams weebhook uri. "User ID=serilog;Password=serilog;Host=localhost;Port=5432;Database=Logs" None, is mandatory.
title The title of the card. "Some Message" None, but is optional.
period The time to wait between checking for event batches. period: new TimeSpan(0, 0, 20) 00:00:05
formatProvider The IFormatProvider to use. Supplies culture-specific formatting information. Check https://docs.microsoft.com/en-us/dotnet/api/system.iformatprovider?view=netframework-4.8. new CultureInfo("de-DE") null
batchSizeLimit The maximum number of events to include in a single batch. batchSizeLimit: 40 30
restrictedToMinimumLevel The minimum level of the logging. restrictedToMinimumLevel: LogEventLevel.Verbose LogEventLevel.Verbose
omitPropertiesSection Indicates whether the properties section should be omitted or not. omitPropertiesSection: true false
proxy The proxy addresss used. proxy: "http://test.de/proxy" null
buttons Add static clickable buttons to each message. buttons: new[] { new MicrosoftTeamsSinkOptionsButton("Google", "https://google.se") } null

Further information:

This project is a fork of https://github.com/DixonDs/serilog-sinks-teams but is maintained. Do not hesitate to create issues or pull requests.

Change history

See the Changelog.

About

Serilog.Sinks.MicrosoftTeams is a library to save logging information from Serilog to Microsoft Teams. The assembly was written and tested in .Net Framework 4.8 and .Net Standard 2.0.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%