log4net配置文件写入appdata路径在framework和netcore中的区别

在netframework中,想将配置文件写入appdata特殊目录使用如下配置:

  <file type="log4net.Util.PatternString" value="%envFolderPath{ApplicationData}\\"></file>

但是当这个配置在netcore上时就无效了

经过研究,需要修改为下面这样:

<file type="log4net.Util.PatternString" value="%env{appdata}\"></file>

posted @ 2020-05-11 18:16  一!雨  阅读(521)  评论(0编辑  收藏  举报