弹性搜索的日志格式是什么?

时间:2017-09-21 12:32:33

标签: elasticsearch logging

elasticsearch日志的示例格式:[2017-08-30T06:27:19,158][WARN ][o.e.m.j.JvmGcMonitorService] [Glsuj_2] [gc][296816] overhead, spent [1.2s] collecting in the last [1.3s]

你能解释一下这是什么意思吗?当我们观察日志? 请解释一下日志中的每个单词?

o.e.m.j.JvmGcMonitorService是什么意思?

Glsuj_2是什么意思?

gc是什么意思?

296816是什么意思?

2 个答案:

答案 0 :(得分:2)

日志消息由JvmGcMonitorService class组成。 我认为这是查找日志记录语义的最佳位置。要求在github is still open上提供文档的故障单。

这也适用于涉及更多的警告,例如SLOW_GC_LOG_MESSAGE

直接回答(部分)你的问题

o.e.m.j.JvmGcMonitorService - 日志记录类的缩写限定名称

Glsuj_2您的节点名称

gc - “垃圾收集” - “gc”在日志字符串中被硬编码

296816 - 序列号,在监控gc时递增

但是日志的有趣部分在它之后开始:spent [1.2s] collecting in the last [1.3s]。同样:括号内的部分由JvmGcMonitorService填充。

答案 1 :(得分:0)

在Tommy的回应之后,日志文件将包含以下详细信息。

[gc][{}][{}][{}] duration [{}], collections [{}]/[{}], total [{}]/[{}], memory [{}]->[{}]/[{}], all_pools {}

使用以下值(按其位置顺序)替换括号。因此,第一个{}从左至右读取,由“名称”的值替换,最后一个由pools.apply(lastJvmStats,currentJvmStats)返回的值替换。

 name,
 seq,
 totalGcCollectionCount,
 currentGcCollectionTime,
 currentGcCollectionCount,
 TimeValue.timeValueMillis(elapsed),
 currentGcCollectionTime,
 totalGcCollectionTime,
 lastJvmStats.getMem().getHeapUsed(),
 currentJvmStats.getMem().getHeapUsed(),
 maxHeapUsed,
 pools.apply(lastJvmStats, currentJvmStats)