log4net中日志文件的通用位置不起作用? [英] common location of log file in log4net not working?

查看:215
本文介绍了log4net中日志文件的通用位置不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在log4net中的日志文件位置有问题.

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

我在此节点上指定了创建日志文件的位置

I gave this node for the location 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

即使我也尝试过AppData,但是它的行为也一样. 我有什么错误吗?

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

是否需要任何转换器来转换环境变量?

Is it required any converter to convert environment variables?

推荐答案

从文档

此示例显示如何配置文件名以使用环境变量TMP <file value="${TMP}\log-file.txt" />

这篇关于log4net中日志文件的通用位置不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆