You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be awesome to have support for child loggers! Imagine creating a child logger for each HTTP request, then set some globals for it (such as the calling user, request info, etc). It would share the transports, formatters and globals of it's parent.
Example API:
constlogger=newBristol({ ... })app.use(authenticate())app.use((ctx,next)=>{constchild=logger.createChildLogger({/*additional config for child */})child.setGlobal('user_id',()=>ctx.state.user.id)ctx.logger=childreturnnext()})app.use(get('/todos',(ctx)=>{ctx.logger.info('Getting todos')}))
The text was updated successfully, but these errors were encountered:
Loving Bristol, and have even written a target + formatter myself. 馃槃
It would be awesome to have support for child loggers! Imagine creating a child logger for each HTTP request, then set some globals for it (such as the calling user, request info, etc). It would share the transports, formatters and globals of it's parent.
Example API:
The text was updated successfully, but these errors were encountered: