2010-12-10 27 views
3

我希望我的日誌記錄進入%ALLUSERSPROFILE%文件夾(或它的子文件夾...)登陸到%ALLUSERSPROFILE%與NLOG文件夾1.0

我使用NLOG 1.0和似乎是網站維基因爲他們正在升級他們的2.0版本的文檔,因此有漏洞。

我使用Win7和嘗試了以下內容:

<target name="file" xsi:type="File" fileName="${%AllUsersProfile%}\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 
<target name="file" xsi:type="File" fileName="${%AllUsersProfile}\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 
<target name="file" xsi:type="File" fileName="${AllUsersProfile}\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 
<target name="file" xsi:type="File" fileName="%AllUsersProfile%\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 
<target name="file" xsi:type="File" fileName="%AllUsersProfile\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 

回答

6

好吧,specialfolder的伎倆

<target name="file" xsi:type="File" fileName="${specialfolder:folder=CommonApplicationData}\Logs\${date:format=yyyy-MM-dd_(HH)}_(pid-${processid}).htm"> 
+0

非常方便,謝謝:) – Jedidja 2011-03-26 17:52:07