运行NUnit时日志位于何处? [英] Where are logs located while running NUnit?
问题描述
我正在从Resharper运行NUnit测试.我想跟踪执行过程,所以我的问题是在哪里可以找到应用程序生成的日志?
I'm running NUnit tests from Resharper. I want to track execution process so my question is where can I find logs produced by my application?
我使用NLog,记录器的输出路径是相对的,例如logs\mylog.txt
.
I use NLog, logger output path is relative, e.g. logs\mylog.txt
.
推荐答案
我与当前项目有相似的设置,对于单元测试,我的NLog输出转到\ UnitTests \ bin \ Debug \ Logs.记录器在NLog.config中设置如下(这会产生一个每日日志文件):
I have a similar setup with my current project and for the unit tests, my NLog output goes to \UnitTests\bin\Debug\Logs. The logger is set up as follows in NLog.config (this produces a daily log file):
<target name="FileLog" xsi:type="File" fileName="${basedir}/logs/${shortdate}_log.txt"
如果您根本无法从NLog获得任何输出,请尝试将throwExceptions,internalLogLevel和internalLogFile属性添加到NLog.config中,如下所示:
If you aren't getting any output at all from NLog, try adding the throwExceptions, internalLogLevel and internalLogFile attributes to your NLog.config like this:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
throwExceptions="true"
internalLogLevel="Debug"
internalLogFile="nlog_log.log">
我意识到这是一个古老的问题,但是以防万一您还没有找到答案,尽管我会看看这是否有帮助.
I realise this is an old question but just in case you haven't found the answer yet, I though I would see if this helps.
这篇关于运行NUnit时日志位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!