Is there a Logback Layout that Creates JSON Objects with Message Parameters as Attributes?

后端 未结 5 839
天命终不由人
天命终不由人 2021-02-02 09:32

I want to send log events to Loggly as JSON objects with parameterized string messages. Our project currently has a lot of code that looks like this:

String some         


        
5条回答
  •  天命终不由人
    2021-02-02 09:46

    You could use a Mapped Diagnostic Context to set a stamp for each of those type of log messages that you could then filter on once in loggly.

    According to the source of JsonLayout the stamp is stored as a separate value in the JSON.

提交回复
热议问题