-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(logger): add service name as context #1287
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating the logger in every class, we can inject it directly with Awilix:
container.register({
logger: asValue(logger),
sessionService: asClass(SessionService)
.singleton()
.inject(() => ({
logger: logger.child(SessionService.name)
})),
})
This solution works as well, but I think it fits better to have everything loaded by Awilix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Context
Changes