Skip to content

Fix exception thrown when LoggerProvider not configured#3423

Merged
lzchen merged 9 commits intoopen-telemetry:mainfrom
lzchen:logs
Sep 7, 2023
Merged

Fix exception thrown when LoggerProvider not configured#3423
lzchen merged 9 commits intoopen-telemetry:mainfrom
lzchen:logs

Conversation

@lzchen
Copy link
Copy Markdown
Contributor

@lzchen lzchen commented Sep 1, 2023

If a LoggerHandler is instantiated without an SDK LoggerProvider, an exception is thrown here since NoOpLogger does not have the resource attribute.

Repro:

...
# do not set SDK Loggerprovider

handler = LoggingHandler(level=logging.NOTSET)
logging.getLogger().addHandler(handler)
logging.info("Jackdaws love my big sphinx of quartz.")
...

@lzchen lzchen requested a review from a team September 1, 2023 20:45
Copy link
Copy Markdown
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments

Copy link
Copy Markdown
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@lzchen lzchen merged commit 6070a0d into open-telemetry:main Sep 7, 2023
@lzchen lzchen deleted the logs branch September 7, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants