Skip to content

Commit

Permalink
Update logs example re root logger (#4090)
Browse files Browse the repository at this point in the history
  • Loading branch information
tammy-baylis-swi authored Jul 30, 2024
1 parent 21f4a20 commit b9cadc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added py.typed file to top-level module ([#4084](https://github.com/open-telemetry/opentelemetry-python/pull/4084))
- Drop Final annotation from Enum in semantic conventions
([#4085](https://github.com/open-telemetry/opentelemetry-python/pull/4085))
- Update log export example to not use root logger ([#4090](https://github.com/open-telemetry/opentelemetry-python/pull/4090))

## Version 1.26.0/0.47b0 (2024-07-25)

Expand Down
5 changes: 2 additions & 3 deletions docs/examples/logs/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
# Attach OTLP handler to root logger
logging.getLogger().addHandler(handler)

# Log directly
logging.info("Jackdaws love my big sphinx of quartz.")

# Create different namespaced loggers
# It is recommended to not use the root logger with OTLP handler
# so telemetry is collected only for the application
logger1 = logging.getLogger("myapp.area1")
logger2 = logging.getLogger("myapp.area2")

Expand Down

0 comments on commit b9cadc0

Please sign in to comment.