【问题标题】:How can I define the location of NLog file in code?如何在代码中定义 NLog 文件的位置?
【发布时间】:2011-10-04 19:48:24
【问题描述】:

有没有办法使用 c# 代码定义 NLog 应该直接使用的配置文件?

【问题讨论】:

    标签: logging configuration nlog


    【解决方案1】:

    你应该可以做这样的事情(注意我没有编译也没有测试过):

    string path = GetThePathToYourNLogConfigFile();
    LogManager.Configuration = new XmlLoggingConfiguration(path);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      • 2019-06-30
      • 2013-02-09
      • 2010-12-19
      • 1970-01-01
      • 1970-01-01
      • 2010-12-11
      相关资源
      最近更新 更多