try:
# Setup logging early, supplying both the CLI options and the
# configuration mapping from the config file options['log_file'] = "%s.log" % app_name setup_logging(options, conf)
and in setup_logging:
# grab log_file and log_dir from config; set to defaults of not already
# defined
logfile = options.get('log_file') or conf.get('log_file', DEFAULT_LOG_FILE)
logdir = options.get('log_dir') or conf.get('log_dir', DEFAULT_LOG_DIR)
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