Comment 1 for bug 897376

Revision history for this message
Jay Pipes (jaypipes) wrote :

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:
        # 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)

    logfile = os.path.join(logdir, logfile)
    logfile = logging.FileHandler(logfile)

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