The ES parses the time in this format to the date type.
Signed-off-by: Wu Zhende wuzhende666@163.com --- lib/json_logger.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/json_logger.rb b/lib/json_logger.rb index 2c33c2f..7a05f79 100644 --- a/lib/json_logger.rb +++ b/lib/json_logger.rb @@ -21,7 +21,7 @@ class JSONLogger < Logger logger_hash = { 'level' => severity.to_s, 'level_num' => level_num, - 'time' => datetime + 'time' => Time.now.strftime("%Y-%m-%dT%H:%M:%S.%3N+0800") }
logger_hash['progname'] = progname if progname