Skip to content

Add support for connection string to Microsoft.ApplicationInsights.NLogTarget #2714

Open

Description

Currently the Microsoft.ApplicationInsights.NLogTarget only supports an instrumentation key. This limits its functionality such that it can only target App Insights in Azure commercial. Also, instrumentation key only configuration is being deprecated (link).

Can connection string support be added to the configuration section of Microsoft.ApplicationInsights.NLogTarget? Below is the current layout of the config in XML form. Could connectionString be an optional element alongside instrumentationKey?

<extensions>
	<add assembly="Microsoft.ApplicationInsights.NLogTarget" />
</extensions>
<targets>
	<target xsi:type="ApplicationInsightsTarget" name="aiTarget">
		<instrumentationKey>Your_Resource_Key</instrumentationKey>	<!-- Only required if not using ApplicationInsights.config -->
		<contextproperty name="threadid" layout="${threadid}" />	<!-- Can be repeated with more context -->
	</target>
</targets>
<rules>
	<logger name="*" minlevel="Trace" writeTo="aiTarget" />
</rules>

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions