logging-config.

Python標準ロギングモジュールのラッパークラス
今すぐダウンロード

logging-config. ランキングとまとめ

広告

  • Rating:
  • ライセンス:
  • BSD License
  • 価格:
  • FREE
  • 出版社名:
  • Gavin M. Roy
  • 出版社のWebサイト:
  • http://area51.myyearbook.com/trac.cgi/wiki/Staplr

logging-config. タグ


logging-config. 説明

logging-configは、標準のPythonロギングパッケージのPythonコンフィギュレーションラッパークラスです。 DictConfiguratorは2.7まで利用できないため、まだサポート2.6をサポートする必要があるため、アプリケーションロギングの構成を処理するための一貫した方法が必要でした。構成辞書スキーマの詳細については、http://docs.python.org/library/logging.config.html# config {'loggers':{'pika':{'propagate' :true、 'level': 'info'}、 'tinman':{'propagate':true、 'level': 'info'}}、 'formatters':{'syslog':( '%(LevelName)s' '%(名前)。%(funcname)s:%(message)s')、 'verbose' :( '%(levelname)-10s%(asctime)s%(name)-30s' '%(funcName) - 25S:%(メッセージ)S ')、' filters ':なし、' syslog ':{' facility ':' local6 '、' level ':' info '、' formatter ':' syslog ' 、 'class': 'logging.handlers.sysloghandler'、 'address': 'console':{'formatter': 'verbose'、 'debug_only':true、 'class': 'logging.streamhandler'、 'level': 'debug'}}}例:yamlファイル "example.yaml":%yaml 1.2 ---ロガー:Pika:Level:情報伝播:true tinman:levate: true file:filename:/var/log/example.logクラス:logging.rotatingFileHandlerモード:A maxbytes:104857600 BackupCount:6エンコード:UTF-8 D Elay:false formatter:verbose filters:my_logger:my_app。* formatters: "%(levelname)-10s%(asctime)s%(name)-30s%(funcName)-25s:%(message)s" syslog: "%(LevelName)s%(name)。%(funcName)s:%(message)s"ハンドラ:console:class:logging.streamHandler formatter:verbug_only:true level:debug syslog:class:logging.handlers.sysloghandler施設:/ var / run / syslogフィルタ: formatter:syslogレベル:次のコードは、指定されたハンドラを使用してロギングモジュールを設定します.import logging_config import yaml( 'example.yaml'、 'r') )CONFIG = YAML.LOAD(ハンドル)CFG = logging_config.logging(config)cfg.setup()製品のホームページ


logging-config. 関連ソフトウェア