How to specify log file path using folder locations in Windows with log4net xml configurator?

我们两清 提交于 2019-12-05 00:29:51

The log4net syntax for expanding environment variables is "${Variable}" e.g.

<file value="${LOCALAPPDATA}\GojiSoft\GojiLog\log.txt" />

Resurrecting an old thread here, but I encountered the same issue and thought I'd share.

${PROGRAMDATA}, as discussed in the comment thread of the other answer, didn't work for me (same as for OP). However, I saw a comment somewhere about it being case sensitive. Tried ${ProgramData} and sure enough, it worked fine.

Use ${APPDATA} instead of ${LOCALAPPDATA}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!