简体   繁体   English

Azure 持久功能日志

[英]Azure durable functions Logs

I'm using a group of durable functions to do some critical backend logic and orchetration and I would like them to write logs in the same file so I can make a better analysis.我正在使用一组持久函数来执行一些关键的后端逻辑和编排,我希望它们将日志写入同一个文件中,以便我可以进行更好的分析。 Right know my I'm using injected ILog instance with the log.Information method but each function write its own log file.知道我正在使用带有 log.Information 方法的注入 ILog 实例,但是每个 function 都编写自己的日志文件。

I'm also using application insights but there is much more information in the files than app insight becauseof the telemetry sampling.我也在使用应用程序洞察力,但由于遥测采样,文件中的信息比应用程序洞察力多得多。

Here is an example of my host.json file "version": "2.0", "logging": { "fileLoggingMode": "always", "logLevel": { "default": "Trace", "Host": "Trace", "Function": "Trace" }, "applicationInsights": { "samplingSettings": { "isEnabled": true, "maxTelemetryItemsPerSecond": 20 } } },这是我的主机的示例。json 文件“版本”:“2.0”,“日志记录”:{“fileLoggingMode”:“始终”,“logLevel”:{“默认”:“跟踪”,“主机”:“跟踪", "Function": "Trace" }, "applicationInsights": { "samplingSettings": { "isEnabled": true, "maxTelemetryItemsPerSecond": 20 } } },

Is there a way to have a single log file?有没有办法拥有一个日志文件?

Thanks谢谢

How about a logging service that the functions can call?函数可以调用的日志服务怎么样? this would solve the problem of concurrent writes as only one service is editing the file.这将解决并发写入的问题,因为只有一个服务正在编辑文件。 Secondly any new functions can just have the same logic added so it's quicker.其次,任何新功能都可以添加相同的逻辑,因此速度更快。

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

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