I am trying to get log output in JSON format. I achieved it by configuring logback.xml file. Is it possible to achieve same by YML file ?
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
<jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
<prettyPrint>true</prettyPrint>
</jsonFormatter>
<timestampFormat>yyyy-MM-dd' 'HH:mm:ss.SSS</timestampFormat>
</layout>
</appender>
As mentioned above in comment It is not possible to configure only in YML file for JSON Layout in logback. My requirement was to set log level ERROR/INFO from YML file. I came to know We can override logback log level by YML file in spring boot. For JSON format configuration one can use logback.xml and for setting log level use YML file