在Mule 3或Mule 4中,打印负载的日志是否有限制?

huangapple go评论68阅读模式
英文:

Is there any log limit for printing payload in mule-3 or Mule-4

问题

我正在尝试在日志记录器中打印包含base64内容的大型JSON。我怀疑整个负载未被打印出来。因为JSON的关闭标签未出现在负载的末尾。请查看正在打印的负载:

{"emailSubject": "TEST : (DocID=000100) (UPI=xxxxyy) Request : Arun, Prema","status": "sent","compositeTemplates": [{"serverTemplates": [{"sequence": 1,"templateId": "0D8DA18B"}],"document":{"name" : " LOA","display" : "inline","documentId" : "1","documentBase64":"JVBERi0.....................................

而且,关闭的双引号也没有出现在末尾。我应该怎么做才能打印整个负载。base64内容在结束标签"documentBase64"处。我们使用的是Mule On-Prem,而不是CloudHub记录。

英文:

I am trying to print huge json with base64 content in the logger. I am suspecting that entire payload is not getting printed. Because json closed tags are not appearing at the end of payload. take a look at the payload that is getting printed

 {"emailSubject": "TEST : (DocID=000100) (UPI=xxxxyy) Request : Arun, Prema","status": "sent","compositeTemplates": [{"serverTemplates": [{"sequence": 1,"templateId": "0D8DA18B"}],"document":{"name" : " LOA","display" : "inline","documentId" : "1","documentBase64":"JVBERi0.....................................

and the closing double quotes are also not there at the ending. what can I do to print entire payload. base64 content is at the ending tag "documentBase64". we are using mule on-prem not using cloudhub logging

答案1

得分: 1

你正在使用错误的工具来实现这个目的。使用记录器来打印大型负载可能会导致问题,例如高内存使用、高CPU使用率或截断/损坏的消息。像log4j2这样的记录器的预期用途是打印日志消息以跟踪应用程序的操作,而不是审计大型负载。如果你想将负载发送到某个地方,比如文件或Splunk,请使用连接器。你可以找到现有的连接器,或者需要创建自己的连接器。

英文:

You are using the wrong tool for that purpose. Using a logger to print big payloads may cause issues like high memory usage, high CPU usage, or truncated/corrupted message. The expected usage of a logger like log4j2 is to print log messages to track what the application is doing, not auditing huge payloads. If you want to send payloads somewhere, like a file or Splunk, use a connector. You could find an existing one or need to create your your own.

huangapple
  • 本文由 发表于 2023年7月20日 18:37:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76729041.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定