I would like to have the same logs go to stdout as well as bot.log, but the log file only logs info messages (no stack traces or anything). this is my logging setup:
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler1 = logging.FileHandler("bot.log")
handler2 = logging.StreamHandler(sys.stdout)
logger.addHandler(handler1)
logger.addHandler(handler2)
class Crewbot(commands.Bot):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.logger = logger
handler = logging.FileHandler("sql.log")
logging.getLogger("sqlalchemy.engine").addHandler(handler)
logging.getLogger("sqlalchemy.engine").setLevel(logging.INFO)
logging.getLogger("sqlalchemy.pool").addHandler(handler)
logging.getLogger("sqlalchemy.pool").setLevel(logging.DEBUG)```