Open
Description
@c24t wish to know your thoughts as you've done the pilot work in #536.
- Currently the
use_oc_logging
works for all loggers created after the call. There is another way to work with loggers created before the call (although it could have wide impact, and only works for Py3.x), should we consider it (which seems to be useful for automatic capturing unhandled exceptions)?
class ContextLogRecord(logging.LogRecord):
def __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None):
self.trace_id = 'foo'
self.span_id = 'bar'
return super(ContextLogRecord, self).__init__(name, level, pathname, lineno, msg, args, exc_info, func, sinfo)
logging.setLogRecordFactory(ContextLogRecord)
- Do we want to move
use_oc_logging
to an ext package and use config_integration?
config_integration.trace_integrations(['logging'])