适用于 Windows 10 UWP 应用的记录器 [英] Logger for Windows 10 UWP app
问题描述
我找不到任何适用于 Windows 10 通用应用程序的记录器,我尝试过 log4net、Microsoft 企业库、Nlog,但 Windows 10 通用平台不支持它们.
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屋!