Commit c0ecf81
Add trace context fields in ElasticsearchLogger (#115)
This commit adds trace context fields to log events
when using ElasticsearchLogger.
The trace context fields are extracted from the current
System.Diagnostics.Activity if not null. When the Id
format used is W3C, the Activity.TraceId and Activity.SpanId
will be used to set Trace.Id and Span.Id, respectively. For
any other id format, Trace.Id and Span.Id will be set from
Activity.RootId and Activity.Id, respectively. When there
is no current Activity but CorrelationManager has an
ActivityId, this will be used for the Trace.Id.
Co-authored-by: Russ Cam <[email protected]>1 parent d1d5b77 commit c0ecf81
File tree
2 files changed
+29
-10
lines changed- src/Elasticsearch.Extensions.Logging
2 files changed
+29
-10
lines changedLines changed: 27 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
141 | | - | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
| |||
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
160 | | - | |
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
| |||
189 | 197 | | |
190 | 198 | | |
191 | 199 | | |
192 | | - | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | 203 | | |
196 | 204 | | |
197 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
198 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
199 | 218 | | |
200 | 219 | | |
201 | 220 | | |
| |||
207 | 226 | | |
208 | 227 | | |
209 | 228 | | |
210 | | - | |
211 | | - | |
| 229 | + | |
212 | 230 | | |
213 | 231 | | |
214 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments