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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights --version 1.0.0                
#r "nuget: DontPanicLabs.Ifx.Telemetry.Logger.Azure.ApplicationInsights, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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