本文介绍了如何命名log4net输出文件和程序集名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何变量可用于命名我的日志文件?

Is there any variable which I could use to name my log files?

<file value="${ALLUSERSPROFILE}\${AssemblyName}.log.xml" />

其中


  • $ {ALLUSERSPROFILE} 真的有效

  • $ {AssemblyName}

  • ${ALLUSERSPROFILE} really works
  • ${AssemblyName} doesn't, it is something I made up just for illustration of what I want.

推荐答案

此语法用于扩展。虽然 ALLUSERSPROFILE 是标准环境变量,但 AssemblyName 不是。你必须自己设置 AssemblyName ,这不会是一个动态解决方案不容易。

This syntax is for expanding Windows Environment Variables. Whilst ALLUSERSPROFILE is a standard environment variable, AssemblyName is not. You would have to set AssemblyName yourself, which will not be easy\possible as a dynamic solution.

这篇关于如何命名log4net输出文件和程序集名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 22:42