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
{{ message }}
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: gdi/get-data-in/application/otel-dotnet/instrumentation/connect-traces-logs.rst
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,11 @@ Connect .NET trace data with logs using OpenTelemetry instrumentation
7
7
.. meta::
8
8
:description: Automatic correlation between logs and traces provided by the Splunk Distribution of OpenTelemetry .NET.
9
9
10
-
The Splunk Distribution of OpenTelemetry .NET automatically exports logs enriched with tracing context from any application that uses logging API from :new-page:`Microsoft.Extensions.Logging <https://www.nuget.org/packages/Microsoft.Extensions.Logging>` for logging.
10
+
The Splunk Distribution of OpenTelemetry .NET automatically exports logs enriched with tracing context from any application that uses logging API from:
.. note:: Automatic log to trace correlation only works for .NET applications. For .NET Framework use manual correlation. See :ref:`manual-trace-logs-correlation-otel`.
55
+
.. note:: Automatic log to trace correlation for ``Microsoft.Extensions.Logging`` only works for .NET applications. For .NET Framework use manual correlation. See :ref:`manual-trace-logs-correlation-otel`.
52
56
53
-
``Microsoft.Extensions.Logging`` version ``9.0.0`` and higher are supported.
57
+
* ``Microsoft.Extensions.Logging`` version ``9.0.0`` and higher are supported,
58
+
* ``log4net`` version from ``2.0.13`` to ``4.0.0`` are supported. Environmental variable ``OTEL_DOTNET_AUTO_LOGS_ENABLE_LOG4NET_BRIDGE`` needs to be set to ``true``.
54
59
55
60
.. _dotnet-otel-enable-log-correlation:
56
61
@@ -94,8 +99,27 @@ Manual log to trace correlation
94
99
95
100
You can configure logging libraries to include tracing attributes in logs written to existing logs destination.
96
101
102
+
``log4net``
103
+
-----------------------------------------------
104
+
105
+
You can modify ``conversionPattern`` in your log4net appender to include tracing attributes in logs written to existing logs destination. Following properties are set by default on the collection of logging event's properties:
You can use :new-page:`NLog.DiagnosticSource <https://www.nuget.org/packages/NLog.DiagnosticSource>`. See the :new-page:`NLog official documentation <https://github.com/NLog/NLog.DiagnosticSource>` for more information.
0 commit comments