我如何处理元素的日志记录集合

问题描述

我正在将日志发布到 ELK 堆栈,但我无法决定应该如何处理日志记录集合。

我正在这些日志记录变体之间进行选择:

a)

INFO (scope/properties/context like UserId,SubscriptionType etc)... Publishing order {OrderId} of type {OrderType} ...
INFO (scope/properties/context like UserId,SubscriptionType etc)... Publishing order {OrderId} of type {OrderType} ...
___
INFO (scope/properties/context like UserId,SubscriptionType etc)... Successfully published order {OrderId} in cart {CartId} ...
INFO (scope/properties/context like UserId,SubscriptionType etc)... Failed publishing order {OrderId} ...
INFO (scope/properties/context like UserId,SubscriptionType etc)... Successfully published order {OrderId} in cart {CartId} ...

b)

INFO (scope/properties/context like UserId,SubscriptionType etc)... Publishing orders {CollectionOfObjectsWithOrderInfo} ...
___
INFO (scope/properties/context like UserId,SubscriptionType etc)... Successfully placed orders {CollectionOfObjectsWithOrderInfo} ...
INFO (scope/properties/context like UserId,SubscriptionType etc)... Failed placing orders {CollectionOfObjectsWithOrderInfo} ...

我正在考虑的要点:

  1. 处理日志的困难
  2. 日志大小
  3. 日志产生的流量

关于第一点,我认为使用日志会更容易,因为过滤和搜索会更灵活。

但我非常担心考虑到第 2 点和第 3 点可能出现的问题。

您将如何处理这种情况?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)