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

feat(logger): disable colors from env #212

Closed intech closed 3 years ago

intech commented 3 years ago

Related: https://github.com/moleculerjs/moleculer-web/issues/204 and https://github.com/moleculerjs/moleculer-web/issues/138

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 525


Totals Coverage Status
Change from base Build 521: -0.06%
Covered Lines: 689
Relevant Lines: 713

💛 - Coveralls
davidnussio commented 3 years ago

I set FORCE_COLOR=0 in production otherwise kibana logs look messy only for api http requests (registered routes, response status code and response times). The others logs looks good.

moleculer-web use internally kelur but ignore moleculer logger colors configuration.

What do you think about read broker.loggerFactory.opts.options.colors into started method and apply value to kleur.enabled?

icebob commented 3 years ago

@davidnussio I've updated the kleur to 4.1.3 and now it considers the FORCE_COLORS flag: image