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. The console transport asks
resolveLoggerColorize()instead of always colorizing intextformat. APP_ENV_LOGGER_COLORis the override. Set it totrueorfalsein any environment.NO_COLORis honored, following the no-color.org convention.ICustomLoggerOptionsgainedcolorize, so an app building its own winston logger can pass the decision in.
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 |
Who is affected
- Anyone running with
NODE_ENV=production,stagingoruat. Console lines lose their color. Nothing else about them changes. - 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. - File and UDP transports. Untouched. They never colorized.
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.