Changelog - 2026-08-22
Logger color follows the environment
Behavior ChangeEnhancementIn one line. Console log lines are colorized in development and plain everywhere else.
What changed
- Color is now a decision, not a constant. The console transport used to call winston's colorizer unconditionally in
textformat. It now asksresolveLoggerColorize()first. APP_ENV_LOGGER_COLORis the override. Set it totrueorfalseto decide for yourself, in any environment.NO_COLORis honored. The no-color.org convention, which most CLI tools already follow.ICustomLoggerOptionsgainedcolorize. An application building its own winston logger can pass the decision in directly.
The first rule that matches wins:
| Rule | Result |
|---|---|
APP_ENV_LOGGER_COLOR is set | That value |
NO_COLOR is set and non-empty | Off |
NODE_ENV is local, debug, development, dev or sit - or unset | On |
Anything else, including production, staging, uat and unrecognized names | Off |
That last row is the same fail-closed boundary the error sanitizer draws. Color is a terminal affordance for our own engineers; every other environment ships its lines to a file or an aggregator, where an escape code is noise every grep has to strip.
Who is affected
- Anyone running with
NODE_ENV=production,stagingoruat. Console lines lose their color. Nothing else about them changes - same timestamp, same label, same message. - Anyone running in development. Nothing changes.
- Applications on the pino provider. The rule is a veto only. When it allows color,
pino-prettystill applies its own terminal detection, so piping to a file stays clean. - File and UDP transports. Untouched. They never colorized, in any environment.
If you want the color back
bash
APP_ENV_LOGGER_COLOR=trueThat works in any environment, and it beats NO_COLOR.
See Logger reference - Color for the full rules.