This document is for an old version of Python that is no longer supported. You should upgrade and read the Python documentation for the current stable release. Basic Logging Tutorial¶ Logging is a means of tracking events that happen when some software runs. The software’s developer adds logging calls to their code to indicate that certain events have occurred. An event is described by a descripti
Javaにはlog4j、.NETにはlog4netがあるように当然Pythonにもログ機能(以下からloggingとします。)は存在しますが、Pythonの場合は標準ライブラリにすでに組み込まれています。 今回はその機能を使用したサンプルを紹介します。 loggingではいくつかのログ出力方式を指定することが可能ですが、今回はログファイルのサイズ指定とローテート指定の行える「RotatingFileHandler」を使用してサンプルを作成します。 その他のログ出力方式は、Python用ロギング機能 を参照してみてください。 今回は、ログ出力用のプログラムファイル(log.py)と設定ファイル(log.conf)を作成します。 注) 設定ファイルを使用せずにプログラムファイルで設定を行うことも可能ですが、一般的にログ設定ファイルを作成しますので今回は設定ファイルを作成します。 また、logg
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く