从AWS lambda日志中删除元数据
我有一个带有许多lambdas的无服务器应用程序。我正在使用 datadog lambda Extensive 将日志推向datadog。
我的lambda日志非常混乱,因为它们具有与每个日志关联的时间戳,请求ID和日志级别(以及Datadog Trace ID)。有没有一种方法可以从日志中删除此元数据,并且只需记录的内容(理想情况下也保留日志级别?)。为了参考,我们使用标准console.log
,console.warn
等...方法。
I have a serverless application with many Lambdas. I'm using the Datadog Lambda Extension to push logs to Datadog.
My Lambda logs are very cluttered since they have the timestamp, requestID, and log level associated with each log (along with the Datadog trace id). Is there a way to remove this metadata from logs, and just have the content that is logged (and ideally preserve the log level too?). For reference, we are using the standard console.log
, console.warn
, etc... methods.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以通过修改控制台对象来解决该问题,并使用新的控制台对象进行记录
The issue can be fixed by modifying the console Object, and use the new console object for logging