-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Provide an ergonomic way to set custom logger prefix #13841
Comments
Hi @kuncevic
Do you have any ideia how to display this prefix message? One suggestion could be:
another suggestion:
Do you have any other suggestions? |
can't we achieve this already with https://docs.nestjs.com/techniques/logger#extend-built-in-logger ? |
@WillianAgostini Ideally, I would see it as an exposed config option that you just stick whatever you want into, not the way it is done atm, that required a lot of boilerplate to fix. Will have to do that for each Nest project in my monorepo....painful. |
Would you like to create a PR for this issue? |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I have multiple apps using Nestjs monorepo setup. In that case if I run all apps at the same time it would be great being able easily to differentiate the log output. By default the console output starts with
[Nest]...
as per this line https://github.com/nestjs/nest/blob/master/packages/common/services/console-logger.service.ts#L226In order to change this behavior you had to provide a custom logger or use another logging library. The pain here is that you must repeat that same action for each app...
Describe the solution you'd like
However I believe that it would be way easier to being able to set a custom prefix out of the box e.g
app.setLoggerPrefix('my-app-name')
Teachability, documentation, adoption, migration strategy
What is the motivation / use case for changing the behavior?
Dev experience
The text was updated successfully, but these errors were encountered: