Hi all I'm trying to change the label in the log. I only want to get {"level":"WARNING","msg":"test"} instead of {"level":"WARN","msg":"test"}.
My class is: package com.abc.def; import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.builder.SpringApplicationBuilder;import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @SpringBootApplicationpublic class Application extends SpringBootServletInitializer { private static final Logger LOG = LoggerFactory.getLogger(Application.class); @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } public static void main(String[] args) { LOG.warn("test"); SpringApplication.run(Application.class, args); } } My logback.xml file is: <?xml version="1.0" encoding="UTF-8"?> <configuration> <property resource="application.properties" /> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> <providers> <logLevel> <fieldName>level</fieldName> </logLevel> <arguments> <includeNonStructuredArguments>false</includeNonStructuredArguments> </arguments> <stackTrace> <fieldName>stack</fieldName> </stackTrace> <message> <fieldName>msg</fieldName> </message> </providers> </encoder> </appender> <root level="INFO"> <appender-ref ref="CONSOLE" /> </root> </configuration> I tried many changes but finally I don't any solution except creating a new class that extends net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder. That seems a big stuff for a very small change. I posted already in stackoverflow https://stackoverflow.com/questions/72476767/how-to-change-the-log-level-label-with-slf4j Thanks for helps
_______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user