Improved file logging example (bug 959610)

- Root logger w/ file handler will log WARNING, ERROR, CRITICAL by default

Change-Id: I36cd07cec85712640daa013563401a3bc52f290c
This commit is contained in:
Dolph Mathews 2012-03-19 14:49:18 -05:00
parent 83bc8c088e
commit ee577163e3
3 changed files with 6 additions and 21 deletions

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ vendor
.venv .venv
.tox .tox
keystone.egg-info/ keystone.egg-info/
run_tests.log *.log
.coverage .coverage
covhtml covhtml
pep8.txt pep8.txt

View File

@ -6,7 +6,7 @@ admin_token = ADMIN
compute_port = 8774 compute_port = 8774
verbose = True verbose = True
debug = True debug = True
#log_config = /etc/keystone/logging.conf #log_config = ./etc/logging.conf.sample
# ================= Syslog Options ============================ # ================= Syslog Options ============================
# Send logs to syslog (/dev/log) instead of to file specified # Send logs to syslog (/dev/log) instead of to file specified

View File

@ -1,5 +1,5 @@
[loggers] [loggers]
keys=root,api,registry,combined keys=root
[formatters] [formatters]
keys=normal,normal_with_name,debug keys=normal,normal_with_name,debug
@ -8,23 +8,8 @@ keys=normal,normal_with_name,debug
keys=production,file,devel keys=production,file,devel
[logger_root] [logger_root]
level=NOTSET level=WARNING
handlers=devel handlers=file
[logger_api]
level=DEBUG
handlers=devel
qualname=glance-api
[logger_registry]
level=DEBUG
handlers=devel
qualname=glance-registry
[logger_combined]
level=DEBUG
handlers=devel
qualname=glance-combined
[handler_production] [handler_production]
class=handlers.SysLogHandler class=handlers.SysLogHandler
@ -36,7 +21,7 @@ args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER)
class=FileHandler class=FileHandler
level=DEBUG level=DEBUG
formatter=normal_with_name formatter=normal_with_name
args=('glance.log', 'w') args=('keystone.log', 'a')
[handler_devel] [handler_devel]
class=StreamHandler class=StreamHandler