anvilresearch / connect

A modern authorization server built to authenticate your users and protect your APIs
http://anvil.io
MIT License
361 stars 86 forks source link

feat(logger): use single instance of bunyan logger (fix rolling files) #353

Closed camfou closed 7 years ago

camfou commented 7 years ago

Hello ! We need to retrieve the bunyan instance in our hooks and protocols. But, if we create another bunyan logger with the same config with rolling file option we may run into issues (trying to close the logfile during another logger writing) This PR transforms the logger in singleton.

Regards, Camille

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 79.75% when pulling 5afda8e62921fd7c6392881a88217b48c784ff17 on camfou:single_logger_instance into 46b118c554b0a603cc531a88ff6f5842071e6c45 on anvilresearch:master.

camfou commented 7 years ago

Bad idea, the returned instance is not a bunyan logger but an express-bunyan-logger which is a middleware instance...