diff options
author | Dolph Mathews <dolph.mathews@gmail.com> | 2013-01-29 11:12:35 -0600 |
---|---|---|
committer | Dolph Mathews <dolph.mathews@gmail.com> | 2013-01-31 08:16:21 -0600 |
commit | 378635224bdc88fef4e150405894be56acfbf0a3 (patch) | |
tree | 5750b43ec35f879dd0693a645135fca84ad9b9c9 /etc/logging.conf.sample | |
parent | 02da3afe4df65b8c469ceb430ca34dab83d6451c (diff) | |
download | keystone-378635224bdc88fef4e150405894be56acfbf0a3.tar.gz keystone-378635224bdc88fef4e150405894be56acfbf0a3.tar.xz keystone-378635224bdc88fef4e150405894be56acfbf0a3.zip |
Generate apache-style common access logs
Taking advantage of this middleware either requires enabling
verbose/debug or utilizing an external logging.conf which configures an
'access' logger.
Example output:
127.0.0.1 - - [2013-01-29T17:15:02.752214] "GET http://localhost:5000/v3/projects HTTP/1.0" 200 16
This patch also revises etc/logging.conf.sample with some more practical
defaults (e.g. supporting externally-managed log rotations) in addition
to illustrating how to generate an 'access.log' file.
DocImpact
Change-Id: I2a6048fa5fbf8661a6859d9e3a259d4cfa5fc589
Diffstat (limited to 'etc/logging.conf.sample')
-rw-r--r-- | etc/logging.conf.sample | 50 |
1 files changed, 38 insertions, 12 deletions
diff --git a/etc/logging.conf.sample b/etc/logging.conf.sample index d87d3a28..6cb8c425 100644 --- a/etc/logging.conf.sample +++ b/etc/logging.conf.sample @@ -1,27 +1,48 @@ [loggers] -keys=root +keys=root,access + +[handlers] +keys=production,file,access_file,devel [formatters] -keys=normal,normal_with_name,debug +keys=minimal,normal,debug -[handlers] -keys=production,file,devel + +########### +# Loggers # +########### [logger_root] level=WARNING handlers=file +[logger_access] +level=INFO +qualname=access +handlers=access_file + + +################ +# Log Handlers # +################ + [handler_production] class=handlers.SysLogHandler level=ERROR -formatter=normal_with_name +formatter=normal args=(('localhost', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER) [handler_file] -class=FileHandler -level=DEBUG -formatter=normal_with_name -args=('keystone.log', 'a') +class=handlers.WatchedFileHandler +level=WARNING +formatter=normal +args=('error.log',) + +[handler_access_file] +class=handlers.WatchedFileHandler +level=INFO +formatter=minimal +args=('access.log',) [handler_devel] class=StreamHandler @@ -29,10 +50,15 @@ level=NOTSET formatter=debug args=(sys.stdout,) -[formatter_normal] -format=%(asctime)s %(levelname)s %(message)s -[formatter_normal_with_name] +################## +# Log Formatters # +################## + +[formatter_minimal] +format=%(message)s + +[formatter_normal] format=(%(name)s): %(asctime)s %(levelname)s %(message)s [formatter_debug] |