opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Logs example does not export info or debug logs

Open TylerHelmuth opened this issue 6 months ago • 1 comments

Describe your environment

OS: macOS Sequoia 15.5 Python version: 3.13.5 SDK version: 1.34.1/0.55b1 API version: 1.34.1/0.55b1

env vars: OTEL_LOG_LEVEL=debug OTEL_PYTHON_LOG_LEVEL=debug

What happened?

When following the logs example instructions and then running the example I do not see the debug or info logs exporter, only the warning and error logs. If I switch the exporter to the console exporter I get the same results.

Steps to Reproduce

Set export OTEL_LOG_LEVEL=debug and export OTEL_PYTHON_LOG_LEVEL=debug.

Then follow the logs example instructions

Expected Result

Info and debug logs exported

Actual Result

Only warning and error logs exported

Additional context

I am seeing this issue in other examples locally, as is an associate from a different company on their machine.

Would you like to implement a fix?

None

TylerHelmuth avatar Jun 20 '25 14:06 TylerHelmuth

Doing

logging.getLogger().setLevel(logging.INFO)

fixes the issue.

TylerHelmuth avatar Jun 20 '25 14:06 TylerHelmuth

I tried to reproduce with no luck using exact same versions of Python and OpenTelemetry packages, using a ConsoleLogExporter instead of OTLPExporter, is it possible there is some setting on OTLP that could be interfering in your environment @TylerHelmuth?

hectorhdzg avatar Jun 23 '25 20:06 hectorhdzg

I see the issue with the console logger as well, but ya I suspect there is something up with my environment.

TylerHelmuth avatar Jun 23 '25 22:06 TylerHelmuth

These environment variables shouldn't impact the example export OTEL_LOG_LEVEL=debug and export OTEL_PYTHON_LOG_LEVEL=debug

emdneto avatar Jun 24 '25 00:06 emdneto