How to disable colors in circleci runner's logs

Hello, folks.
I am using CircleCi self-hosted runners in K8S. There is a Datadog agent that scrapes all logs from all pods and streams them into the DataDog Logs system. The problem is in shell coloring, it breaks heuristic in log processing, look:

10:15:03 e[1;38;5;92m181b4e[0m 15.025ms e[1;38;5;203mworker loop: claim: e[0m app.backoff_ms=5000 app.loop_name=claim: mode=agent result=success service.name=circleci-runner service_name=circleci-runner

DataDog can’t parse them automatically and show them as errors by default.
I can go way around with Grok and reprocess them, but what is better and more consistent - to disable coloring with some environment variable, like:
CIRCLECI_RUNNER_DISABLE_COLORS=True

What did I miss there and what do you think?

Excuse me, but can we avoid AI members in this thread? It makes no sense.

1 Like

After grep -a "color" circleci-runner I found this section in binary:

yaml:"format" env:"FORMAT" 
enum:"text,color,json,none" default:"color"

So I will use something like that:
CIRCLECI_RUNNER_LOGGING_FORMAT=json

Closing ticket.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.