【发布时间】:2017-02-24 13:14:38
【问题描述】:
我正在尝试让 nlog 使用 Azure webapp 日志流。
如果我不使用 nlog 会出现日志,而只需使用 System.Diagnostics.Trace.WriteLine。
但是,如果我在我的 nlog.config 中使用 Trace 类型,它不会显示跟踪日志...
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target xsi:type="Trace" name="trace" layout="${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="trace" />
</rules>
</nlog>
我看不出我所做的与此处接受的答案有什么不同...
How to integrate NLog to write log to Azure Streaming log
请注意,我删除了该 nlog.config 文件以仅显示跟踪 - 但我通常也有一个 File 目标类型 - 我尝试过使用和不使用这个。
我已经登录到部署的Azure网站,nlog配置文件已经上传成功。我正在使用 Github 部署进行部署。
我在 Azure 中将日志记录设置为仅使用文件系统日志记录,并将其设置为 verbose。
有什么想法吗?
【问题讨论】: