Skip to content

Instantly share code, notes, and snippets.

@suganoo suganoo/logging property
Last active Sep 5, 2017

Embed
What would you like to do?
logging propertyのフォーマット
[loggers]
keys=root,hogehogetool
[handlers]
keys=defaultHandler,hogehogetoolHandler
[formatters]
keys=simpleFormatter
[logger_root]
level=INFO
handlers=defaultHandler
[logger_hogehogetool]
#!!! describe same level for logger and hander
level=INFO
handlers=hogehogetoolHandler
propagate=0
qualname=hogehogetool
[handler_defaultHandler]
class=StreamHandler
level=INFO
formatter=simpleFormatter
args=(sys.stdout,)
[handler_hogehogetoolHandler]
class=FileHandler
#!!! describe same level for logger and hander
level=INFO
formatter=simpleFormatter
args=("/var/log/hogehogetool/hogehogetool.log","a")
[formatter_simpleFormatter]
format=%(asctime)s [%(levelname)s] pid:%(process)d %(module)s.%(funcName)s : %(message)s
datefmt=%Y-%m-%d %H:%M:%S
import logging
import logging.config
logging.config.fileConfig(”(logging property path)”)
self.logger = logging.getLogger("hogehogetool")
@suganoo

This comment has been minimized.

Copy link
Owner Author

commented Sep 1, 2017

import logging
import logging.config
logging.config.fileConfig(”(logging property path)”)
self.logger = logging.getLogger("hogehogetool")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.