J Person
J Person

Reputation: 1229

Spring Boot still outputs colour even with spring.output.ansi.enabled=NEVER

I want to disable colour in the Spring Boot output completely as the logs are going to be viewed as plaintext, not in a terminal.

If I pass in --spring.output.ansi.enabled=NEVER as a command line argument it disables some colour such as the text saying Spring Boot, but the logs immediately after are as colourful as always. How can I disable all colour entirely?

Upvotes: 9

Views: 5209

Answers (1)

Alik
Alik

Reputation: 256

I had simular issue with logback.xml. Resolved it by setting withJansi to false and removing colors from pattern. Like this:

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <withJansi>false</withJansi>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

Upvotes: 1

Related Questions