Commit c4fc9a9
fix(logging): remove log correlation attributes from ddtrace loggers (#14979)
## Description
Fixes ddtrace internal logging errors when trace-log correlation is
disabled programmatically.
## Problem
ddtrace internal logs were expecting correlation attributes
(`dd.service`, etc.) even when log injection was disabled, causing
`ValueError: Formatting field not found in record` errors.
## Solution
Removed set_log_formatting to prevent mismatches between expected and
actual log record attributes. When log correlation is disabled but
DD_LOG_FORMAT is set, internal ddtrace logs can raise a ValueError. This
also prevents issues when user configured log formatters override log
formatters set by ddtrace. Since span start and finish now emit debug
logs, including trace attributes in all ddtrace log records is no longer
necessary.
## Testing
Verified ddtrace internal logs work correctly with correlation disabled.
## Risks
None - fixes existing bug.
(cherry picked from commit b433817)1 parent 7451e84 commit c4fc9a9
File tree
4 files changed
+7
-18
lines changed- ddtrace
- contrib/internal/logging
- releasenotes/notes
- tests/integration
4 files changed
+7
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 113 | | |
122 | 114 | | |
123 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 102 | | |
111 | 103 | | |
112 | 104 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
811 | | - | |
812 | | - | |
| 811 | + | |
| 812 | + | |
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
| |||
0 commit comments