简体   繁体   English

Dynamics AX集中式日志记录

[英]Dynamics AX centralized logging

Our application consists of a web API that handles frontend app requests, some middleware that passes the request to Dynamics, and Dynamics AX in the backoffice that ultimately handles the request and generates a response. 我们的应用程序包括一个处理前端应用程序请求的Web API,一些将请求传递给Dynamics的中间件,以及在后台处理最终请求并生成响应的Dynamics AX。

Now we want to introduce some centralised logging (ELK, Seq), so that all layers log to some central place where we can view/search log entries. 现在,我们要引入一些集中式日志记录(ELK,Seq),以便所有层都记录到某个中央位置,我们可以在其中查看/搜索日志条目。 What options does Dynamics AX offer to write log statements to some central location? Dynamics AX提供哪些选项将日志语句写入某个中央位置?

If I understand your question correctly, you need something to log the end-to-end request/responses to and from AX. 如果我正确理解了您的问题,则需要一些东西来记录与AX之间的端到端请求/响应。

The middleware could therefore be the best place to do the logging. 因此,中间件可能是进行日志记录的最佳位置。 It can log the requests sent to it, the subsequent request sent to AX, the response from AX, and the response that was finally sent back to the caller. 它可以记录发送给它的请求,发送给AX的后续请求,来自AX的响应以及最终发送回调用方的响应。

Assuming the middleware logging is easy enough to implement using any number of logging frameworks, the communication to AX services uses WCF, So take a look at enabling this in your application: 假设中间件日志记录很容易使用任意数量的日志记录框架实现,则与AX服务的通信使用WCF,因此请看一下如何在应用程序中启用它:

https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/configuring-message-logging https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/configuring-message-logging

Example here: 这里的例子:

https://www.codeproject.com/Articles/383162/Logging-and-Tracing-WCF-Soap-Messages https://www.codeproject.com/Articles/383162/Logging-and-Tracing-WCF-Soap-Messages

This will give you the option to log all of the end-to-end communcation, to one logger. 这使您可以选择将所有端到端通信记录到一个记录器中。


AX also has it's own AIF logging, but this logs to it's own internal database: AX还拥有自己的AIF日志记录,但这会记录到自己的内部数据库中:

https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/monitoring-services-and-aif https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/monitoring-services-and-aif

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

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