Closed VolkerSchiewe closed 1 year ago
Closing because I didn't execute the log tracing extension before initialising the logger which was calling logger.exception
. Learning: if you are using opencensus-ext-logging
make sure to run config_integration.trace_integrations(["logging"])
before any logger is initialised.
Note that loggers are often initialised when importing files!
Describe your environment. Python 3.11.3-slim-bullseye FastAPI 0.95.0 opencensus "^0.11.2" opencensus-ext-azure = "1.1.7" opencensus-ext-logging = "^0.1.1" opencensus-ext-requests = "^0.8.0" opencensus-ext-fastapi = "^0.1.0"
Steps to reproduce.
opencensus-ext-logging
opencensus-ext-azure
logger.exception(e)
What is the expected behavior? traceId and spanId are injected into all logs independent of log level
What is the actual behavior? TraceId and SpanId are part of info log level but not of warning or error level
Additional context.