NLog.Targets.AppCenter
6.0.2
Prefix Reserved
dotnet add package NLog.Targets.AppCenter --version 6.0.2
NuGet\Install-Package NLog.Targets.AppCenter -Version 6.0.2
<PackageReference Include="NLog.Targets.AppCenter" Version="6.0.2" />
<PackageVersion Include="NLog.Targets.AppCenter" Version="6.0.2" />
<PackageReference Include="NLog.Targets.AppCenter" />
paket add NLog.Targets.AppCenter --version 6.0.2
#r "nuget: NLog.Targets.AppCenter, 6.0.2"
#:package NLog.Targets.AppCenter@6.0.2
#addin nuget:?package=NLog.Targets.AppCenter&version=6.0.2
#tool nuget:?package=NLog.Targets.AppCenter&version=6.0.2
NLog.Targets.AppCenter
NLog Target for Microsoft Visual Studio App Center with Azure
⚠️ Microsoft AppCenter will be retired - https://learn.microsoft.com/appcenter/retirement
How to setup NLog in MAUI
Install the NLog packages
Install-Package NLog.Targets.AppCenterInstall-Package NLog.Extensions.Logging
or in your csproj:
<PackageReference Include="NLog.Targets.AppCenter" Version="6.*" /> <PackageReference Include="NLog.Extensions.Logging" Version="6.*" />Add NLog to the MauiApp
Update
MauiProgram.csto include NLog as Logging Provider:var builder = MauiApp.CreateBuilder(); // Add NLog for Logging builder.Logging.ClearProviders(); builder.Logging.AddNLog();If getting compiler errors with unknown methods, then update
using-section:using Microsoft.Extensions.Logging; using NLog; using NLog.Extensions.Logging;Load NLog configuration for logging
Add the
NLog.config-file into the Application-project as assembly-resource (Build Action=embedded resource), and load like this:NLog.LogManager.Setup().RegisterAppCenter() .LoadConfigurationFromAssemblyResource(typeof(App).Assembly);Alternative setup NLog configuration using fluent-API:
var logger = NLog.LogManager.Setup().RegisterAppCenter() .LoadConfiguration(c => c.ForLogger().FilterMinLevel(NLog.LogLevel.Debug).WriteToAppCenter()) .GetCurrentClassLogger();
Configuration options for AppCenter NLog Target
- AppSecret - Appsecret for starting AppCenter if needed (optional)
- UserId - Application UserId to register in AppCenter (optional)
- LogUrl - Base URL (scheme + authority + port only) to the AppCenter-backend (optional)
- CountryCode - Two-letter ISO country code to send to the AppCenter-backend (optional)
- DataResidencyRegion - Country Code or other identifier of data residency region (optional)
- ReportExceptionAsCrash - Report all exceptions as crashes to AppCenter (default=false)
- IncludeEventProperties - Include LogEvent properties in AppCenter properties (default=true)
- IncludeScopeProperties - Include MappedDiagnosticsLogicalContext (MLDC) that can be provided with MEL BeginScope (default=false)
Example NLog.config file
<nlog throwConfigExceptions="true">
<extensions>
<add assembly="NLog.Targets.AppCenter"/>
</extensions>
<targets>
<target name="appcenter" type="appcenter" layout="${message}" reportExceptionAsCrash="true">
<contextproperty name="logger" layout="${logger}" />
<contextproperty name="loglevel" layout="${level}" />
<contextproperty name="threadid" layout="${threadid}" />
</target>
</targets>
<rules>
<logger name="*" minLevel="Info" writeTo="appcenter" />
</rules>
</nlog>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- Microsoft.AppCenter.Analytics (>= 5.0.7)
- Microsoft.AppCenter.Crashes (>= 5.0.7)
- NLog (>= 6.0.2)
-
.NETStandard 2.0
- Microsoft.AppCenter.Analytics (>= 5.0.7)
- Microsoft.AppCenter.Crashes (>= 5.0.7)
- NLog (>= 6.0.2)
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 |
|---|---|---|
| 6.0.2 | 461 | 7/20/2025 |
| 6.0.1 | 203 | 6/28/2025 |
| 6.0.0 | 247 | 6/23/2025 |
| 5.2.3 | 247 | 6/4/2025 |
| 5.2.2 | 904 | 6/1/2024 |
| 5.2.1 | 12,384 | 10/15/2023 |
| 5.2.0 | 3,442 | 5/30/2023 |
| 5.0.2 | 18,481 | 12/15/2022 |
| 5.0.1 | 558 | 12/12/2022 |
| 5.0.0 | 879 | 11/26/2022 |
| 2.4.0 | 1,885 | 7/31/2022 |
| 2.3.0 | 10,506 | 11/29/2021 |
| 2.2.0 | 3,016 | 6/26/2021 |
| 2.1.0 | 10,817 | 9/28/2020 |
| 2.0.1 | 1,087 | 9/24/2020 |
| 2.0.0 | 1,706 | 7/25/2020 |
| 1.1.0 | 12,516 | 12/6/2019 |
| 1.0.0 | 3,452 | 9/17/2019 |
- NLog v6.0.2 with AOT support
- Notice Microsoft AppCenter will be retired - https://learn.microsoft.com/appcenter/retirement