Skip to content

Use __name__ instead of __file__ for logging statements #787

@phillipuniverse

Description

@phillipuniverse

I am trying to turn on logging for opentelemetry.instrumentation.auto_instrumentation.sitecustomize. However, this uses __file__ in the getLogger() call:

Because of this, the logger name is something like this:

/Users/phillip/Library/Caches/pypoetry/virtualenvs/project-cpwchxt0-py3.6/lib/python3.6/site-packages/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py

Instead of what I would expect it to be, opentelemetry.instrumentation.auto_instrumentation.sitecustomize.

Wondering if there is a particular reason to use __file__ instead of name?

If it helps, I am not using otel-trace to run, I am directly importing sitecustomize and running my application (Django) with:

/Users/phillip/path/to/project/manage.py runserver 8000

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions