how to specify log_dir for oslo_log

asked 2017-06-12 09:49:23 -0500

瑞瑞哥 gravatar image

here is an example of usage , but I did not know where to specify the log_dir

from oslo_config import cfg
from oslo_log import log as logging

LOG = logging.getLogger(__name__)
CONF = cfg.CONF
DOMAIN = 'demo'

extra_log_level_defaults = [
    'dogpile=INFO',
    'routes=INFO'
    ]

logging.set_defaults(
    default_log_levels=logging.get_default_log_levels() +
    extra_log_level_defaults)

# Required setup based on configuration and domain
logging.setup(CONF, DOMAIN)

LOG.error("An error occurred")

So , where can I specify the log_dir ? If I use CONF(default_conf_files=["test.conf"]) , then it says oslo_config.cfg.DuplicateOptError: duplicate option: debug

edit retag flag offensive close merge delete