Skip to content

Commit 1c917a7

Browse files
authored
Update README.md
1 parent 24b4f06 commit 1c917a7

File tree

1 file changed

+11
-32
lines changed

1 file changed

+11
-32
lines changed

README.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ X.Serilog.Sinks.Telegram is an open-source Serilog sink that allows you to send
2323

2424
- **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.
2525

26-
- **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.
26+
- **Customizable Formatting**: You can configure the format of log messages sent to the Telegram channel, allowing you to tailor them to your preferences and specific requirements.
2727

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

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

3232
- **Easy Configuration**: Configuring the sink to work with your Telegram channel is straightforward, and you can find comprehensive information in the [Configuration Wiki](https://github.com/Bardin08/X.Serilog.Sinks.Telegram/wiki/Configuration).
3333

@@ -40,46 +40,25 @@ To begin using the X.Serilog.Sinks.Telegram sink, follow these steps:
4040
dotnet add package X.Serilog.Sinks.Telegram
4141
```
4242

43-
2. **Configure the Sink**: In your application's configuration, set up the Telegram sink with the appropriate settings. Here's an example configuration in C#:
43+
2. **Configure the Sink**: Set up the Telegram sink with the appropriate settings in your application's configuration. Here's an example configuration in C#:
4444

4545
```c#
46-
var logger = new LoggerConfiguration()
47-
.Telegram(config =>
48-
{
49-
config.Token = "your_telegram_bot_token";
50-
config.ChatId = "your_chat_id";
51-
config.BatchPostingLimit = 10;
52-
config.Mode = LoggingMode.Logs;
53-
config.FormatterConfiguration = new FormatterConfiguration
54-
{
55-
UseEmoji = true,
56-
ReadableApplicationName = "MyTestApp",
57-
IncludeException = true,
58-
IncludeProperties = true
59-
};
60-
config.BatchEmittingRulesConfiguration = new BatchEmittingRulesConfiguration
61-
{
62-
// Batch Emitting rules configuration here...
63-
};
64-
config.LogFiltersConfiguration = new LogsFiltersConfiguration
65-
{
66-
ApplyLogFilters = true,
67-
FiltersOperator = LogFiltersOperator.Or,
68-
Filters = new List<IFilter> {
69-
// Your filters here...
70-
}
71-
};
72-
}, null, LogEventLevel.Debug)
46+
Log.Logger = new LoggerConfiguration()
47+
.WriteTo.TelegramCore(
48+
token: botToken,
49+
chatId: loggingChatId,
50+
logLevel: LogEventLevel.Verbose)
51+
.WriteTo.Console()
7352
.CreateLogger();
7453
```
7554

76-
3. **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.
55+
3. **Start Logging**: Once the sink is configured, you can log in using Serilog as usual. Log events will be sent to your Telegram channel.
7756

7857
For more detailed configuration options, please refer to the [Configuration Wiki](https://github.com/Bardin08/X.Serilog.Sinks.Telegram/wiki/Configuration).
7958

8059
## Examples
8160

82-
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.
61+
This repository includes several example projects that demonstrate how to use X.Serilog.Sinks.Telegram in various scenarios. These examples can be helpful if you're starting or looking to use a specific feature.
8362

8463
You can find the examples in the following location: [X.Serilog.Sinks.Telegram Examples](https://github.com/Bardin08/X.Serilog.Sinks.Telegram/tree/main/examples)
8564

0 commit comments

Comments
 (0)