Skip to content

LoggingEventCompositeJsonEncoder [ignore] message field error. #485

Answered by philsttr
Liudapeng asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Liudapeng

To ignore the message field when using LoggingEventCompositeJsonEncoder, do not configure the message json provider.

This example includes the message provider. Therefore, the message field will be written.

<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
  <providers>
    <timestamp/>
    <version/>
    <logLevel/>
    <loggerName/>
    <message/>
    <mdc/>
    <stackTrace/>
  </providers>
</encoder>

And this example does NOT include the message provider. Therefore, the message field will NOT be written.

<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
  <providers>
    <timestamp/>
    <version/>
    <logLevel/…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by philsttr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #433 on January 17, 2021 20:06.