NLog.Targets.MauiLog
10.0.3
Prefix Reserved
dotnet add package NLog.Targets.MauiLog --version 10.0.3
NuGet\Install-Package NLog.Targets.MauiLog -Version 10.0.3
<PackageReference Include="NLog.Targets.MauiLog" Version="10.0.3" />
<PackageVersion Include="NLog.Targets.MauiLog" Version="10.0.3" />
<PackageReference Include="NLog.Targets.MauiLog" />
paket add NLog.Targets.MauiLog --version 10.0.3
#r "nuget: NLog.Targets.MauiLog, 10.0.3"
#:package NLog.Targets.MauiLog@10.0.3
#addin nuget:?package=NLog.Targets.MauiLog&version=10.0.3
#tool nuget:?package=NLog.Targets.MauiLog&version=10.0.3
NLog.Targets.MauiLog
NLog Target for debugging on MAUI / Xamarin Mobile Platforms:
- Apple iOS / MacOS - Unified Logging OSLog (replacement of print and NSLog)
- Android - Android.Util.Log / LogCat
- NetStandard - System.Diagnostics.Debugger.Log
How to setup NLog in MAUI
Install the NLog packages
Install-Package NLog.Targets.MauiLogInstall-Package NLog.Extensions.Logging
or in your csproj (Use ver. 8 for NET8, and ver. 9 for NET9 etc.):
<PackageReference Include="NLog.Targets.MauiLog" Version="10.*" /> <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().RegisterMauiLog() .LoadConfigurationFromAssemblyResource(typeof(App).Assembly);Alternative setup NLog configuration using fluent-API:
var logger = NLog.LogManager.Setup().RegisterMauiLog() .LoadConfiguration(c => c.ForLogger().FilterMinLevel(NLog.LogLevel.Debug).WriteToMauiLog()) .GetCurrentClassLogger();
Configuration options for MAUI Log Target
- Layout - LogEvent message layout
- Category - LogEvent category layout (optional)
Example NLog.config-file:
<nlog>
<extensions>
<add assembly="NLog.Targets.MauiLog" />
</extensions>
<targets>
<target name="mauilog" type="MauiLog" />
</targets>
<rules>
<logger name="*" minLevel="Info" writeTo="mauilog" />
</rules>
</nlog>
See also Logging Unhandled Exceptions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-macos26.0 is compatible. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on NLog.Targets.MauiLog:
| Repository | Stars |
|---|---|
|
ciribob/DCS-SimpleRadioStandalone
An open source Stand alone Radio for DCS integrating with all clickable cockpits and FC3 Aircraft
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.3 | 3,274 | 11/23/2025 |
| 9.0.3 | 2,153 | 11/4/2025 |
| 8.6.2 | 15,589 | 7/20/2025 |
| 8.6.1 | 2,875 | 6/28/2025 |
| 8.6.0 | 840 | 6/22/2025 |
| 8.0.0 | 89,270 | 1/9/2024 |
| 7.6.2 | 383 | 7/20/2025 |
| 7.6.1 | 170 | 6/28/2025 |
| 7.6.0 | 223 | 6/22/2025 |
| 7.0.0 | 1,366 | 1/9/2024 |
| 6.6.2 | 384 | 7/20/2025 |
| 6.6.1 | 168 | 6/28/2025 |
| 6.6.0 | 222 | 6/22/2025 |
| 6.0.0 | 890 | 1/9/2024 |
| 5.2.1 | 10,476 | 10/16/2023 |
| 5.2.0 | 7,462 | 5/30/2023 |
| 1.0.4 | 2,503 | 4/11/2023 |
| 1.0.3 | 308 | 4/10/2023 |
| 1.0.2 | 18,226 | 11/22/2022 |
| 1.0.1 | 1,799 | 10/25/2022 |
- MAUI ver. 10.0
- Updated to NLog v6.0.3 with AOT-support
See https://github.com/NLog/NLog.Targets.MauiLog for documentation of NLog targets for MAUI