Reputation: 2430
Suddenly the log format in run/debug tab of intelliJ has changed from default format to the json fromt as mentioned below. I am not sure how it got changed or how to revert it. It is hard to read/debug the code log from this format.
{"instant":{"epochSecond":1630330436,"nanoOfSecond":197120650},"thread":"main","level":"INFO","loggerName":"com.useargo.bi.dashboard.DashboardServiceApplication","message":"No active profile set, falling back to default profiles: default","endOfBatch":false,"loggerFqcn":"org.apache.commons.logging.LogAdapter$Log4jLog","threadId":1,"threadPriority":5}
It is a spring boot application and i am using default SLF4J logger.
does any one how to revert it back to the default/original format?
Thanks.
Upvotes: 1
Views: 2746
Reputation: 3400
It will be hard to tell what changed in your project. Check for any JSON/Logstash encoder that got added into your project recently, or any custom log configurations that was recently introduced.
For local dev and debug needs, I keep a gitignored copy of the following xml (logback.xml
) in the project classpath, inside src/main/resources
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<property name="CONSOLE_LOG_PATTERN" value="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %X{id} %c{1} - %msg%n" />
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>utf8</charset>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE_APPENDER" />
</root>
</configuration>
Here is the documentation which gives information on how patterns work.
Upvotes: 2