From de51bd28d78effb8f1228f87b16498999aa1a9f7 Mon Sep 17 00:00:00 2001 From: Ming Deng Date: Sun, 28 Jun 2020 21:12:12 +0800 Subject: [PATCH] Fix ES index problem --- logs/es/es.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/logs/es/es.go b/logs/es/es.go index 8d787839..d2281afb 100644 --- a/logs/es/es.go +++ b/logs/es/es.go @@ -60,8 +60,8 @@ func (el *esLogger) WriteMsg(when time.Time, msg string, level int) error { } idx := LogDocument{ - timestamp: when.Format(time.RFC3339), - msg: msg, + Timestamp: when.Format(time.RFC3339), + Msg: msg, } body, err := json.Marshal(idx) @@ -87,8 +87,8 @@ func (el *esLogger) Flush() { } type LogDocument struct { - timestamp string - msg string + Timestamp string `json:"timestamp"` + Msg string `json:"msg"` } func init() {