diff --git a/docs/tgbotapi/logs.md b/docs/tgbotapi/logs.md new file mode 100644 index 0000000..7c41e56 --- /dev/null +++ b/docs/tgbotapi/logs.md @@ -0,0 +1,15 @@ +# Logging + +In this library we are using [KSLog](/kslog) for logging of events in telegram bots. There are several ways to set it +up and configure. + +* Globally, you may change [DefaultKTgBotAPIKSLog]() logger __BEFORE__ creating of your bots +* Granular, you may configure and pass `logger` variable to the `KtorRequestsExecutor` + +Besides, you always may pass your logger to the bot via `KtorRequestsExecutorBuilder`: + +```kotlin +val bot = telegramBot(YOUR_TOKEN) { + logger = KSLog("SomeLogger") +} +``` diff --git a/mkdocs.yml b/mkdocs.yml index dd2b763..4a2ca41 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,7 @@ nav: - 'tgbotapi/index.md' - KDocs: 'https://tgbotapi.inmo.dev' - 'tgbotapi/faq.md' + - 'tgbotapi/logs.md' - Introduction: - 'tgbotapi/introduction/before-any-bot-project.md' - 'tgbotapi/introduction/including-in-your-project.md'