🔖

Pythonでログをファイルに出力する

2024/03/08に公開
import logging

logging.basicConfig(level=logging.INFO, filename="/var/log/app.log")

logging.info("var/log/app.logにInfoのログを出力")

https://docs.python.org/ja/3/howto/logging.html

Discussion