DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry
0.5.1
Prefix Reserved
dotnet add package DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry --version 0.5.1
NuGet\Install-Package DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry -Version 0.5.1
<PackageReference Include="DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry" Version="0.5.1" />
<PackageVersion Include="DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry" Version="0.5.1" />
<PackageReference Include="DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry" />
paket add DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry --version 0.5.1
#r "nuget: DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry, 0.5.1"
#:package DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry@0.5.1
#addin nuget:?package=DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry&version=0.5.1
#tool nuget:?package=DontPanicLabs.Ifx.Telemetry.Logger.Azure.OpenTelemetry&version=0.5.1
Azure Open Telemetry Logger Implementation
This project provides an implementation of the DontPanicLabs.Ifx.Telemetry.Logger.ILogger
interface using Azure Open Telemetry.
Configuration Sections
ifx
Required config:
This package requires only one configuration item - the open telemetry connection string.
Configuration File Example:
{
"ifx": {
"openTelemetry": {
"connectionString": "copy open telemetry connection string from azure portal"
}
}
}
Environment Variable Example:
ifx__openTelemetry__connectionString="copy open telemetry connection string from azure portal"
Configuration Exceptions
When creating a new instance of the DontPanicLabs.Ifx.Telemetry.Logger.OpenTelemetry.Logger
, the constructor will attempt to read the Open Telemetry connection string from the
configuration.
If the configuration key does not exist in the hosting environment, the underlying DontPanicLabs.Ifx.Configuration.Local
package will throw a NullConfigurationValueException
.
If the configuration key exists, but value is empty, the logger will throw an EmptyConnectionStringException
.
Custom Property Logging
Open Telemetry does not support custom properties to be logged for Log()
and Exception()
methods. If the developer attempts to pass custom properties to these methods, a
PlatformNotSupportedException
will be thrown. If you need to log custom properties, use the Event()
method.
Logging Methods
Log()
The Log()
method will log a trace to Azure Monitor. The developer can specify the message and log severity. Custom properties are not supported. These messages can be found in the traces
table in Azure Monitor.
Event()
The Event()
method will log a custom event to Azure Monitor. The developer can specify the event name, custom properties, and custom metrics. Custom properties can be used for
advanced queries in Azure Monitor. These events can be found in the customEvents
table in Azure Monitor.
Exception()
The Exception()
method will log an exception to Azure Monitor. The developer can specify the exception. Custom properties are not supported in Open Telemetry. These exceptions
can be found in the exceptions
table in Azure Monitor, or under the Failures tab in the Azure Monitor portal.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Azure.Monitor.OpenTelemetry.Exporter (>= 1.4.0)
- DontPanicLabs.Ifx.Configuration.Local (>= 1.0.1)
- DontPanicLabs.Ifx.Telemetry.Logger.Contracts (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.