Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/X.Extensions.Logging.Telegram/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var options = new TelegramLoggerOptions(LogLevel.Information)
{
AccessToken = "1234567890:AAAaaAAaa_AaAAaa-AAaAAAaAAaAaAaAAAA",
ChatId = "-0000000000000",
Source = "Human Readable Project Name"
FormatterConfiguration = new FormatterConfiguration { ReadableApplicationName = "Human Readable Project Name" }
};

...
Expand Down Expand Up @@ -42,7 +42,9 @@ builder
},
"AccessToken": "1234567890:AAAaaAAaa_AaAAaa-AAaAAAaAAaAaAaAAAA",
"ChatId": "1234567890",
"Source": "Human Readable Project Name"
"FormatterConfiguration": {
"ReadableApplicationName": "Human Readable Project Name"
}
}
},
"AllowedHosts": "*"
Expand Down Expand Up @@ -84,4 +86,4 @@ private ITelegramMessageFormatter CreateFormatter(string name)
logBuilder.AddTelegram(options, CreateFormatter);
```

For using custom message formatter delegate Func<string, ITelegramMessageFormatter> should be passed to extensions method AddTelegram. Delegate should be used because formatter needs to know which category is used for rendering the message.
For using custom message formatter delegate Func<string, ITelegramMessageFormatter> should be passed to extensions method AddTelegram. Delegate should be used because formatter needs to know which category is used for rendering the message.