summaryrefslogtreecommitdiffstats
path: root/keystone/config.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2013-01-21 15:17:10 +0000
committerMark McLoughlin <markmc@redhat.com>2013-01-22 08:45:52 +0000
commit49447c26a410fface3f77d78f980a8274f2a701e (patch)
tree8bed7b8810aad3e9c00646f0b2c50c1215865315 /keystone/config.py
parent8748cfa3a6b7573550e7ec8ced87e6fd2096a628 (diff)
downloadkeystone-49447c26a410fface3f77d78f980a8274f2a701e.tar.gz
keystone-49447c26a410fface3f77d78f980a8274f2a701e.tar.xz
keystone-49447c26a410fface3f77d78f980a8274f2a701e.zip
Sync latest cfg from oslo-incubator
Changes include: c5984ba Move logging config options into the log module 7cf016a Fixing the trim for ListOp when reading from config file The most significant change is that cfg no longer provides logging config options as these have been moved to the log module which keystone does not yet use. Define these options in keystone.config where they are used since pulling in oslo logging isn't appropriate if we're not going to use it. Change-Id: I3913ea54465658d93dc56e014dfe5d911b0541d6
Diffstat (limited to 'keystone/config.py')
-rw-r--r--keystone/config.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/keystone/config.py b/keystone/config.py
index c26a518c..34ab2b99 100644
--- a/keystone/config.py
+++ b/keystone/config.py
@@ -24,8 +24,46 @@ from keystone.openstack.common import cfg
gettext.install('keystone', unicode=1)
+_DEFAULT_LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s"
+_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
+
+common_cli_opts = [
+ cfg.BoolOpt('debug',
+ short='d',
+ default=False,
+ help='Print debugging output (set logging level to '
+ 'DEBUG instead of default WARNING level).'),
+ cfg.BoolOpt('verbose',
+ short='v',
+ default=False,
+ help='Print more verbose output (set logging level to '
+ 'INFO instead of default WARNING level).'),
+]
+
+logging_cli_opts = [
+ cfg.StrOpt('log-config',
+ metavar='PATH',
+ help='If this option is specified, the logging configuration '
+ 'file specified is used and overrides any other logging '
+ 'options specified. Please see the Python logging module '
+ 'documentation for details on logging configuration '
+ 'files.'),
+ cfg.StrOpt('log-date-format',
+ default=_DEFAULT_LOG_DATE_FORMAT,
+ metavar='DATE_FORMAT',
+ help='Format string for %%(asctime)s in log records. '
+ 'Default: %(default)s'),
+ cfg.BoolOpt('use-syslog',
+ default=False,
+ help='Use syslog for logging.'),
+ cfg.StrOpt('syslog-log-facility',
+ default='LOG_USER',
+ help='syslog facility to receive log lines')
+]
CONF = cfg.CONF
+CONF.register_cli_opts(common_cli_opts)
+CONF.register_cli_opts(logging_cli_opts)
def setup_logging(conf):