tano
tano

Reputation: 896

Play - disable Logger colors

I'm using play.api.Logger to log in my Play application like:

import play.api.Logger
Logger.info("message to log")

By default this will use shell colors resulting in something like this

[[37minfo[0m] application - message to log

if the terminal you're using doesn't support colors.

Is there a way to tell Logger to not use colors?

Upvotes: 3

Views: 777

Answers (3)

tano
tano

Reputation: 896

Found the answer here. The -Dsbt.log.noformat=true disables console log colors.

Upvotes: 2

Michael Vaughan
Michael Vaughan

Reputation: 101

You can modify the log pattern inside conf/logback.xml. The default pattern is:

<pattern>%coloredLevel - %logger - %message%n%xException</pattern>

You could change it to:

<pattern>%level - %logger - %message%n%xException</pattern>

Upvotes: 2

vvg
vvg

Reputation: 6385

You can configure sbt/activator to show logs entries without colors. Just start it with property -no-colors

Upvotes: 1

Related Questions