logback.xml effects on IntelIj console default colors, how I can fix it?

Answered

Hi, please tell me how I can configure my logback.xml that it didn't effect on my IntelliJ console ? I mean without adding <conversionRule/>
Screenshots before and after

 
 
 
0
2 comments

You can try with the following pattern in your logback.xml configuration:

<encoder>
        <pattern>%date [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n</pattern>
</encoder>

Sample logback.xml file:

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%date [%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n</pattern>
        </encoder>
    </appender>

    <root level="debug">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>
1

It worked, thank you very much. 

1

Please sign in to leave a comment.