moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
291 stars 118 forks source link

Globaly disable colored log output (also for external modules) #172

Closed nbvehbq closed 4 years ago

nbvehbq commented 4 years ago

Options logger.options.colors used only for 'Console' logger. I want set it to false, but for external loggers this has no effect.

Thats why in themoleculer-web` for example i see colored output when use Bunyan as external logger

In my opinion logger.options.colors should be extendet to external loggers

What do you think?

icebob commented 4 years ago

Try adding the following codes to the top of moleculer.config.js:

const kleur = require("kleur");
kleur.enabled = false;

Example: https://repl.it/@icebob/moleculer-dev-caller

davidnussio commented 3 years ago

I disabled moleculer-web colorized logs by setting FORCE_COLOR=0 as environment variable. kleur documentation

intech commented 3 years ago

@davidnussio https://github.com/moleculerjs/moleculer-web/pull/212 what do you think about how to control the FORCE_COLOR variable from the COLORS variable supported in the moleculer?

1xtr commented 1 year ago

Try adding the following codes to the top of moleculer.config.js:

const kleur = require("kleur");
kleur.enabled = false;

Example: https://repl.it/@icebob/moleculer-dev-caller

It's not work for me. I use runner and Winston logger. API Gateway logs are durty "message":" \u001b[35m POST\u001b[39m \u001b[36m/\u001b[39m\u001b[90m => \u001b[39mdata.main"

even with FORCE_COLOR=0

"moleculer": "^0.14.29",
"moleculer-web": "^0.10.5",