Skip to content

Commit 70b4045

Browse files
majorgreysbrettlangdon
authored andcommitted
Patch logging earlier for ddtrace-run (#832)
* Patch logging earlier for ddtrace-run * Use patch rather than patch_all * Update ddtrace/bootstrap/sitecustomize.py Co-Authored-By: majorgreys <[email protected]>
1 parent 781e1cc commit 70b4045

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ddtrace/bootstrap/sitecustomize.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
'[dd.trace_id=%(dd.trace_id)s dd.span_id=%(dd.span_id)s] ' if logs_injection else ''
1616
)
1717

18+
if logs_injection:
19+
# immediately patch logging if trace id injected
20+
from ddtrace import patch; patch(logging=True) # noqa
21+
1822
debug = os.environ.get("DATADOG_TRACE_DEBUG")
1923

2024
# Set here a default logging format for basicConfig

0 commit comments

Comments
 (0)