开发者

common location of log file in log4net not working?

开发者 https://www.devze.com 2023-02-22 07:33 出处:网络
I have an issue with the location of log file in log4net. I gave this node for the loc开发者_JAVA百科ation to create the log file

I have an issue with the location of log file in log4net.

I gave this node for the loc开发者_JAVA百科ation to create the log file

 <file type="log4net.Util.PatternString" value="%ALLUSERSPROFILE%\MyProject\error.txt/>

As I think it should create the log file in user folder. But this one is creating in the

bin\debug\ALLUSERSPROFILE\MyProject\error.txt

Even I tried AppData also but its behaving the same. Am I doing any mistake??

Is it required any converter to convert environment variables?


From the documentation Apache log4net file appender

This example shows how to configure the file name to write to using an environment variable TMP <file value="${TMP}\log-file.txt" />


I think you should use it as follows:

<file type="log4net.Util.PatternString" value="${ALLUSERSPROFILE}\MyProject\error.txt/>
0

精彩评论

暂无评论...
验证码 换一张
取 消