Windows 10 UWP应用程序的记录器 [英] Logger for Windows 10 UWP app
问题描述
我找不到Windows 10 Universal应用程序的任何记录器,我已经尝试过log4net,Microsoft企业库,Nlog,但Windows 10 Universal平台均不支持它们.
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.
有人可以为我推荐适用于Windows 10 UWP的好的记录器吗?
Can anyone suggest me good logger for the windows 10 UWP?
推荐答案
您是否尝试过MetroLog?您可以使用NuGet进行安装:
Have you tried MetroLog? You can install it using NuGet:
Install-Package MetroLog
这是一个简单的例子:
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.");
您可以在 http:/上找到说明如何将其添加到项目中的教程. /talkitbr.com/2015/06/11/adicionando-logs-em-universal-apps .另外,还有关于检索这些日志的说明.
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.
这篇关于Windows 10 UWP应用程序的记录器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!