Answer the question
In order to leave comments, you need to log in
Why does the logger not save logs to a file?
I am writing a small bot, I decided to fasten logging to it.
I created a separate module inside, in which I created a logger:
import logging
logging.basicConfig(level='INFO', filename='Mylogs.log')
MainLogger = logging.getLogger('Admin')
@dp.message_handler(CommandStart())
async def greetings_user(message: types.Message):
from loggmodule import MainLogger
MainLogger.info(f'{message.from_user.id} подключился к боту')
logging.basicConfig
. How to fix so that the logging is written to a file, and not displayed in the terminal?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question