0
任何一個可以告訴你怎麼應用默認路徑傳遞給nlog.config文件默認應用程序路徑使用
<target xsi:type="file" name="error" fileName="E://..//customeExceptionErrorLog.log"
layout=" ${exception}"/>
標籤下的文件名是在這裏硬編碼但我想用硬代碼的路徑並使用默認的應用程序根路徑。
任何一個可以告訴你怎麼應用默認路徑傳遞給nlog.config文件默認應用程序路徑使用
<target xsi:type="file" name="error" fileName="E://..//customeExceptionErrorLog.log"
layout=" ${exception}"/>
標籤下的文件名是在這裏硬編碼但我想用硬代碼的路徑並使用默認的應用程序根路徑。
使用${basedir} n日誌可變
$ {BASEDIR} - 當前應用程序域的基本目錄。
像這樣的東西應該爲你工作:
<target xsi:type="file" name="error"
fileName="${basedir}/customeExceptionErrorLog.log"
layout=" ${exception}"/>