Logging not being configured from config file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Low
|
Jay Pipes |
Bug Description
Trying to track down issues with most recent version of Keystone not working in Glance's functional integration tests any more...
Turns out logging doesn't seem to be getting configured properly:
jpipes@
Traceback (most recent call last):
File "/home/
execfile(
File "/home/
'keystone-
File "/home/
setup_
File "/home/
logfile = logging.
File "/usr/lib/
StreamHandl
File "/usr/lib/
stream = open(self.
IOError: [Errno 2] No such file or directory: '/var/log/
jpipes@
log_file = /tmp/test.
As you can see, keystone doesn't seem to be honouring the log_file setting in the supplied configuration file and instead tries to find a log file in /var/log/
Could someone let me know if this changed recently and/or how to fix?
Thanks,
-jay
Changed in keystone: | |
assignee: | nobody → Jay Pipes (jaypipes) |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in keystone: | |
milestone: | none → essex-2 |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | essex-2 → 2012.1 |
After looking into the code, I see this in keystone. common. config. load_paste_ app:
conf_file, conf = load_paste_ config( app_name, options, args)
try:
options[ 'log_file' ] = "%s.log" % app_name
setup_ logging( options, conf)
# Setup logging early, supplying both the CLI options and the
# configuration mapping from the config file
and in setup_logging:
# grab log_file and log_dir from config; set to defaults of not already get('log_ file') or conf.get( 'log_file' , DEFAULT_LOG_FILE) get('log_ dir') or conf.get('log_dir', DEFAULT_LOG_DIR)
# defined
logfile = options.
logdir = options.
logfile = os.path. join(logdir, logfile) FileHandler( logfile)
logfile = logging.
So, by setting options['log_file'] in load_paste_app, Keystone is essentially overriding anything set in the config file :(
Changing the options['log_file'] = ... line to this:
if not conf.get( 'log_file' ):
options[ 'log_file' ] = "%s.log" % app_name
Solves the problem.
-jay