Problem :
I am using Logback in my spring boot application. The problem is logback do not print my logger messages in 'eclipse' console ?
Solution ;-
just reread the logback config doku. Actually, those two should inherit both appenders from root. So, what you can try is to not specify any appender-ref on those and see what happens. If no output is written to the file then, neither - then there is something pretty strange. I'd expect that behavior if the additivity flag was set to false. But the default is appender accumulation
<logger name="package.web" level="INFO" >
<appender-ref ref="FILE" />
</logger>
You need to add the console appender.
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
</encoder>
</appender>
<logger name="package.web" level="INFO" >
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</logger>
credit->https://stackoverflow.com/questions/45502073/logback-cant-write-in-console
Comments
Post a Comment