X.Serilog.Sinks.Telegram 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package X.Serilog.Sinks.Telegram --version 2.0.0
NuGet\Install-Package X.Serilog.Sinks.Telegram -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="X.Serilog.Sinks.Telegram" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add X.Serilog.Sinks.Telegram --version 2.0.0
#r "nuget: X.Serilog.Sinks.Telegram, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install X.Serilog.Sinks.Telegram as a Cake Addin
#addin nuget:?package=X.Serilog.Sinks.Telegram&version=2.0.0

// Install X.Serilog.Sinks.Telegram as a Cake Tool
#tool nuget:?package=X.Serilog.Sinks.Telegram&version=2.0.0

X.Serilog.Sinks.Telegram

Build status

NuGet NuGet Downloads

Table of Contents

Introduction

X.Serilog.Sinks.Telegram is an open-source Serilog sink that allows you to send log events to Telegram. It's a convenient way to integrate Telegram as a logging output, enabling you to receive important log information directly in your chat.

Features

  • Real-time Logging: The sink offers the ability to send log events to a Telegram channel in real-time, ensuring that you can stay up-to-date with your application's behavior and any issues as they arise.

  • Customizable Formatting: You have the flexibility to configure the format of log messages sent to the Telegram channel, allowing you to tailor them to your preferences and specific requirements.

  • Filtering: The sink supports filtering log events before they are dispatched to the Telegram channel, ensuring that only pertinent information is shared.

  • Asynchronous Sending: Log events are sent asynchronously to the Telegram channel, minimizing any potential impact on your application's performance.

  • Easy Configuration: Configuring the sink to work with your Telegram channel is straightforward, and you can find comprehensive information in the Configuration Wiki.

Getting Started

To begin using the X.Serilog.Sinks.Telegram sink, follow these steps:

  1. Install the Package: You can install the sink package from NuGet using the following command:
dotnet add package X.Serilog.Sinks.Telegram
  1. Configure the Sink: In your application's configuration, set up the Telegram sink with the appropriate settings. Here's an example configuration in C#:
var logger = new LoggerConfiguration()
    .Telegram(config =>
    {
        config.Token = "your_telegram_bot_token";
        config.ChatId = "your_chat_id";
        config.BatchPostingLimit = 10;
        config.Mode = LoggingMode.Logs;
        config.FormatterConfiguration = new FormatterConfiguration
        {
            UseEmoji = true,
            ReadableApplicationName = "MyTestApp",
            IncludeException = true,
            IncludeProperties = true
        };
        config.BatchEmittingRulesConfiguration = new BatchEmittingRulesConfiguration
        {
            // Batch Emitting rules configuration here...
        };
        config.LogFiltersConfiguration = new LogsFiltersConfiguration
        {
            ApplyLogFilters = true,
            FiltersOperator = LogFiltersOperator.Or,
            Filters = new List<IFilter> {
                // Your filters here...
            }
        };
    }, null, LogEventLevel.Debug)
    .CreateLogger();
  1. Start Logging: Once the sink is configured, you can start logging using Serilog as you normally would. Log events will be sent to your Telegram channel.

For more detailed configuration options, please refer to the Configuration Wiki.

Examples

This repository includes a number of example projects that demonstrate how to use X.Serilog.Sinks.Telegram in various scenarios. These examples can be very helpful if you're just getting started or looking to use a specific feature.

You can find the examples in the following location: X.Serilog.Sinks.Telegram Examples

Contributing

Feel free to add any improvements you want via pull requests. All pull requests must be linked to an issue.

License

This project is licensed under the MIT Licensehttps://en.wikipedia.org/wiki/MIT_License.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.1.1 413 3/12/2024
3.0.0 169 2/18/2024
2.0.0 1,856 8/11/2023
1.0.0 1,441 8/24/2021