You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/log-correlation.asciidoc
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,6 @@ endif::[]
6
6
[[log-correlation]]
7
7
== Log correlation
8
8
9
-
10
9
The Elastic APM .NET agent provides integrations for popular logging frameworks, which take care of
11
10
injecting trace ID fields into your application's log records. Currently supported logging frameworks are:
12
11
@@ -20,7 +19,12 @@ If your favorite logging framework is not already supported, there are two other
20
19
21
20
Regardless of how you integrate APM with logging, you can use {filebeat-ref}[Filebeat] to
22
21
send your logs to Elasticsearch, in order to correlate your traces and logs and link from
22
+
ifeval::["{branch}"=="7.9"]
23
23
APM to the {apm-app-ref}/xpack-logs.html[Logs app].
24
+
endif::[]
25
+
ifeval::["{branch}"!="7.9"]
26
+
APM to the {observability-guide}/monitor-logs.html[Logs app].
27
+
endif::[]
24
28
25
29
[[serilog]]
26
30
=== Serilog
@@ -67,7 +71,7 @@ With this setup the application will send all the logs automatically to Elastics
67
71
[[nlog]]
68
72
=== NLog
69
73
70
-
For NLog, we offer two https://github.com/NLog/NLog/wiki/Layout-Renderers[LayoutRenderers] that inject the current trace and transaction id into logs.
74
+
For NLog, we offer two https://github.com/NLog/NLog/wiki/Layout-Renderers[LayoutRenderers] that inject the current trace and transaction id into logs.
71
75
72
76
In order to use them, you need to add the https://www.nuget.org/packages/Elastic.Apm.NLog[Elastic.Apm.NLog] NuGet package to your application and load it in the `<extensions>` section of your NLog config file:
73
77
@@ -109,7 +113,7 @@ For correlating structured logs with traces, the following fields should be adde
109
113
110
114
- `trace.id`
111
115
- `transaction.id`
112
-
116
+
113
117
Given a transaction object, you can obtain its trace id by using the `Transaction.TraceId` property and its transaction id by using the `Transaction.Id` property.
114
118
115
119
You can also use the <<api-current-transaction, Elastic.Apm.Agent.Tracer.CurrentTransaction>> property anywhere in the code to access the currently active transaction.
0 commit comments