【发布时间】:2020-09-30 02:07:28
【问题描述】:
这是我的布局:
<target xsi:type="File" name="ownFile-web" fileName="c:\temp\nlog-own-${shortdate}.log"
layout="${longdate}|${aspnet-request-ip}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
</targets>
${aspnet-request-ip} 部分不起作用。
我已经安装了 nlog 和 nlog.web。两者都在 dotnet 核心中 版本。
【问题讨论】:
-
您是否尝试过激活内部记录器并检查警告和错误? github.com/NLog/NLog/wiki/Internal-logging
-
您更新到最新的 NLog 4.5-rc07 + NLog.Web.AspNetCore 4.5.0-rc3 并检查您的配置代码是否与 Wiki 匹配:github.com/NLog/NLog.Web/wiki/…