Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
logger.info(traceback.print_exc()) ログファイルではなくコンソールでトレース取得を実行すると、logger.propagate = Falseまだ同じ問題があります
logger.info(traceback.print_exc())
logger.propagate = False
print_excスタック トレースを stderr に出力します。
print_exc
exc_info=1 引数を使用するだけで、自動的に例外が含まれます。
logging.exception("Exception") #or logging.error("exception ",exc_info=1) #or logging.info("Exception has occured" ,exc_info=1)