asp.net core 3 使用nlog日志组件,使用$ {basedir}保存位置不对,记录下怎么解决
2021-03-28 16:27
                         标签:sep   filename   date   and   div   director   level   mic   min    $ {basedir}指向的是  AppDomain.CurrentDomain.BaseDirectory, Asp.Net.Core的解决方法可能如下(在Program.cs中添加两行):   然后,您可以   asp.net core 3   使用nlog日志组件,使用$ {basedir}保存位置不对,记录下怎么解决 标签:sep   filename   date   and   div   director   level   mic   min    原文地址:https://www.cnblogs.com/tianfengcc/p/12619025.htmlvar appBasePath = System.IO.Directory.GetCurrentDirectory();
NLog.GlobalDiagnosticsContext.Set("appbasepath", appBasePath);
var logger = LogManager.LoadConfiguration("nlog.config").GetCurrentClassLogger();
${gdc:item=appbasepath}在nlog.config:"1.0"?>
 本文出自:http://tianfeng.cc/Article/5879
文章标题:asp.net core 3 使用nlog日志组件,使用$ {basedir}保存位置不对,记录下怎么解决
文章链接:http://soscw.com/essay/69125.html