Logging from Java app to ELK without need for parsing logs

后端 未结 4 1372
无人及你
无人及你 2020-12-28 19:06

I want to send logs from a Java app to ElasticSearch, and the conventional approach seems to be to set up Logstash on the server running the app, and have logstash parse the

4条回答
  •  礼貌的吻别
    2020-12-28 19:34

    I think it's usually ill-advised to log directly to Elasticsearch from a Log4j/Logback/whatever appender, but I agree that writing Logstash filters to parse a "normal" human-readable Java log is a bad idea too. I use https://github.com/logstash/log4j-jsonevent-layout everywhere I can to have Log4j's regular file appenders produce JSON logs that don't require any further parsing by Logstash.

提交回复
热议问题