Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Logger for Windows 10 UWP app

Tags:

I couldn't found any loggers for windows 10 universal app, i have tried out log4net, Microsoft enterprise library, Nlog but none of them are supported in windows 10 Universal platform.

Can anyone suggest me good logger for the windows 10 UWP?

like image 331
Rashmin Javiya Avatar asked Oct 01 '15 11:10

Rashmin Javiya


People also ask

How do I debug a UWP app?

Debug an installed UWP app on a local machineIn Visual Studio, select Debug > Other Debug Targets > Debug Installed App Package. In the Debug Installed App Package dialog, under Connection Type, select Local Machine. Under Installed App Packages, select the app you want to debug, or type its name in the search box.

Can UWP apps access registry?

However, in a Universal Windows Platform application, access to the Registry is forbidden.

What is UWP apps in Windows 10?

Universal Windows Platform (UWP) apps (formerly Windows Store apps and Metro-style apps) are applications that can be used across all compatible Microsoft Windows devices, including personal computers (PCs), tablets, smartphones, Xbox One, Microsoft HoloLens, and Internet of Things.

Can UWP run on Windows 10?

UWP is one choice for creating apps that run on Windows 10 and Windows 11 devices, and can be combined with other platforms.


1 Answers

Have you tried MetroLog? You can install it using NuGet:

Install-Package MetroLog 

Here's an quick example:

using MetroLog; using MetroLog.Targets;  LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget());  ILogger log = LogManagerFactory.DefaultLogManager.GetLogger<MainPage>();  log.Trace("This is a trace message."); 

You can find a tutorial explaining how to add it on your project at http://talkitbr.com/2015/06/11/adicionando-logs-em-universal-apps. Also there is an explanation regarding retrieving these logs.

like image 144
talkitbr Avatar answered Oct 16 '22 11:10

talkitbr