log module has nova specific default settings

Bug #1076821 reported by yong sheng gong
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
New
Undecided
Unassigned

Bug Description

log_opts = [
    cfg.StrOpt('logging_context_format_string',
               default='%(asctime)s %(levelname)s %(name)s [%(request_id)s '
                       '%(user_id)s %(project_id)s] %(instance)s'
                       '%(message)s',
               help='format string to use for log messages with context'),
    cfg.StrOpt('logging_default_format_string',
               default='%(asctime)s %(process)d %(levelname)s %(name)s [-]'
                       ' %(instance)s%(message)s',
               help='format string to use for log messages without context'),
    cfg.StrOpt('logging_debug_format_suffix',
               default='%(funcName)s %(pathname)s:%(lineno)d',
               help='data to append to log format when level is DEBUG'),

with these settings, it is difficult for other components to use it.

Revision history for this message
yong sheng gong (gongysh) wrote :

Not all of RPC calling has the [%(request_id)s '
                       '%(user_id)s %(project_id)s] %(instance)s'

Revision history for this message
yong sheng gong (gongysh) wrote :

Can handler have two formaters at the same time?
for handler in log_root.handlers:
        datefmt = CONF.log_date_format
        if CONF.log_format:
            handler.setFormatter(logging.Formatter(fmt=CONF.log_format,
                                                   datefmt=datefmt))
        handler.setFormatter(LegacyFormatter(datefmt=datefmt))

Mark McLoughlin (markmc)
affects: openstack-common → oslo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.