title: Keycloak logging to JSON format message field
body: <p>I have been trying to set up keycloak logging to be scraped by fluentd to be used in elasticsearch. So far I have used the provided CLI string to use in my helm values script.</p>
  
  <pre><code>  cli:
      # Custom CLI script
      custom: |
        /subsystem=logging/json-formatter=json:add(exception-output-type=formatted, pretty-print=true, meta-data={label=value})
        /subsystem=logging/console-handler=CONSOLE:write-attribute(name=named-formatter, value=json)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/V9G1m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V9G1m.png" alt="Keycloak logs"></a></p>
  
  <p>However, as you can see in the picture provided, the logs that are generated seem to be completely json apart from the core of the log, the message field. Currently the message field is provided as comma separated key-value pairs. Is there any way to tell keycloak, jboss or wildfly that it needs to provide the message in JSON too? This allows me to efficiently search through the data in elastic.</p>