简体   繁体   English

登录 Azure function V1

[英]Nlog in Azure function V1

Thanks in advance.提前致谢。

I want to use Nlog in Azure function V1,I have added Nlog and config file.I can see the ilogger object getting created, but that is not writing to console:(我想在 Azure function V1 中使用 Nlog,我已经添加了 Nlog 和配置文件。我可以看到 ilogger object 没有被创建,但那是写到控制台:

Only tracewriter provided by Azure function alone working in console log.只有 Azure function 单独在控制台日志中提供的跟踪器。

Have never tried deploying an Azure Function, but many seems to have issues with deploying NLog.config (or other resource/config-files).从未尝试过部署 Azure Function,但许多人似乎在部署 NLog.config (或其他资源/配置文件)时遇到问题。

Maybe try putting the NLog-configuration into appsetting.json (Requires explicit load of NLogLoggingConfiguration ):也许尝试将 NLog 配置放入 appsetting.json (需要显式加载NLogLoggingConfiguration ):

https://github.com/NLog/NLog.Extensions.Logging/wiki/Json-NLog-Config https://github.com/NLog/NLog.Extensions.Logging/wiki/Json-NLog-Config

The NLog Trace Target (with rawWrite=true) should support Azure Streaming Log. NLog Trace Target (rawWrite=true)应该支持 Azure Streaming Log。

See also: https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-cloud-logging-with-Azure-function-or-AWS-lambda另请参阅: https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-cloud-logging-with-Azure-function-or-AWS-lambda

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM