使用NLog,$ {basedir}在哪里? [英] Where is ${basedir} located, using NLog?

查看:795
本文介绍了使用NLog,$ {basedir}在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除非我完全丢失它,否则我会以为 NLog文档使用在其示例中,而没有说明其位置应该是什么.

Unless I'm totally missing it, I'm under the impression that the NLog documentation uses ${basedir} in its examples, without explaining what its location is supposed to be.

在哪里可以找到列出所有可能选项的有意义说明的信息?

Where can I find information that lists all possible options with a meaningful description?

我定义了以下配置:

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
  <targets>
    <target name="file" xsi:type="File"
                layout="${longdate} ${logger} ${message}"
                fileName="${basedir}/logs/${shortdate}.txt"
                keepFileOpen="false"
                encoding="iso-8859-2" />
  </targets>
  <rules>
    <logger name="*" minlevel="Debug" writeTo="file" />
  </rules>
</nlog>

据我所知,它可以正常工作,但是我不知道它在哪里记录任何信息.

It works as far as I can tell, but I haven't got a clue where it logs anything at.

推荐答案

${basedir}-应用程序运行的目录,又名. AppDomain.BaseDirectory

${basedir} — Directory where the application runs, aka. AppDomain.BaseDirectory

我认为,您会发现本手册页面很有帮助.

I think, you will find this manual page helpful.

这篇关于使用NLog,$ {basedir}在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆