Enter the% AllUsersProfile% folder using Nlog 1.0

I want my entries to be in the% AllUsersProfile% folder (or its subfolder ...)

I am using NLog 1.0 and it looks like the wiki has holes in it as they update their documentation for release 2.0.

I am using Win7 and have tried the following:

<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">
+3
source share
1 answer

Ok, specialfolder does the trick

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

Source: https://habr.com/ru/post/1779564/


All Articles