3

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?

tano
  • 836
  • 1
  • 10
  • 25

3 Answers3

2

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>
2

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

Community
  • 1
  • 1
tano
  • 836
  • 1
  • 10
  • 25
1

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

vvg
  • 6,325
  • 19
  • 36