DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights
1.0.0
Prefix Reserved
dotnet add package DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights --version 1.0.0
NuGet\Install-Package DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights -Version 1.0.0
<PackageReference Include="DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights" Version="1.0.0" />
paket add DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights --version 1.0.0
#r "nuget: DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights, 1.0.0"
// Install DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights as a Cake Addin #addin nuget:?package=DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights&version=1.0.0 // Install DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights as a Cake Tool #tool nuget:?package=DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights&version=1.0.0
Azure Application Insights Logger Implementation
This project provides an implementation of the DontPanicLabs.Ifx.Telemetry.Logger.ILogger
interface using Azure Application Insights.
Configuration Sections
ifx
This package requires only one configuration item:
Configuration File Example:
{
"ifx": {
"telemetry": {
"logging": {
"applicationInsights": {
"ConnectionString": "copy app insights connection string from azure portal"
}
}
}
}
}
Environment Variable Example:
ifx__telemetry__logging__applicationInsights__ConnectionString="copy app insights connection string from azure portal"
Configuration Exceptions
When creating a new instance of the DontPanicLabs.Ifx.Telemetry.Logger.ApplicationInsights.Logger
, the constructor will attempt to read the Application Insights 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
.
Logging Methods
Log()
The Log()
method will log a trace to Application Insights. The developer can specify the message, log severity, and custom properties. Custom properties can be used for advanced queries in Application Insights. These messages can be found in the traces
table in Application Insights.
Event()
The Event()
method will log a custom event to Application Insights. The developer can specify the event name, custom properties, and custom metrics. Custom properties can be used for advanced queries in Application Insights. These events can be found in the customEvents
table in Application Insights.
Exception()
The Exception()
method will log an exception to Application Insights. The developer can specify the exception and custom properties. Custom properties can be used for advanced queries in Application Insights. These exceptions can be found in the exceptions
table in Application Insights, or under the Failures tab in the Application Insights 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. |
-
net8.0
- DontPanicLabs.Ifx.Configuration.Local (>= 1.0.0)
- DontPanicLabs.Ifx.Telemetry.Logger.Contracts (>= 1.0.0)
- Microsoft.Extensions.Logging.ApplicationInsights (>= 2.22.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 84 | 1/17/2025 |