将 ${basedir} 更改为 NLog.config 中的参考桌面

change ${basedir} to reference desktop in NLog.config

我需要找到一种方法在 NLog.config 文件中引用桌面上的目录。 当前 NLog 目标设置为:

fileName="${basedir}/Daily Logs/TGTLogFile${date:format=yyyyMMdd}.txt"

我需要它指向 ...Desktop/Daily Logs/TGTLogFile${date:format=yyyyMMdd}.txt

它不能是引用我的用户文件夹的静态字符串,因为此应用程序在多台计算机上使用。

如有任何帮助,我们将不胜感激。

有一个特殊文件夹布局渲染器:

用它代替 ${basedir}:

fileName="${specialfolder:folder=DesktopDirectory}/Daily Logs/TGTLogFile${date:format=yyyyMMdd}.txt"

docs of ${specialfolder} and list of all renderers