Best practices for using Markers in SLF4J/Logback

后端 未结 5 1031
花落未央
花落未央 2020-12-12 08:18

We are using SLF4J+Logback combination at our project for a while now and are quite happy with it, but our logging strategy is fairly simple, using straightforward class bas

5条回答
  •  离开以前
    2020-12-12 08:52

    Just as an addendum, if you are using logstash and have json logging enabled, there's another potential use of Marker - for logging variables to associate with a specific log message. This is more consistent and easier to parse than including it in the message body. Very useful, if it suits your use-case.

    See details here:

    https://github.com/logstash/logstash-logback-encoder#loggingevent_custom_event

提交回复
热议问题