Last active
September 5, 2017 07:05
-
-
Save suganoo/ad8e1a0a67351bfac7949f1b688b8c70 to your computer and use it in GitHub Desktop.
logging propertyのフォーマット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.config | |
logging.config.fileConfig(”(logging property path)”) | |
self.logger = logging.getLogger("hogehogetool") |
Author
suganoo
commented
Sep 1, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment