Where are logs located while running NUnit?

让人想犯罪 __ 提交于 2019-12-10 18:29:19

问题


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?

I use NLog, logger output path is relative, e.g. logs\mylog.txt.


回答1:


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"


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.



来源:https://stackoverflow.com/questions/4438614/where-are-logs-located-while-running-nunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!