Skip to content
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

[QUESTION] Log level when using as NestJS app logger #411

Closed
navmed opened this issue Jan 11, 2021 · 4 comments
Closed

[QUESTION] Log level when using as NestJS app logger #411

navmed opened this issue Jan 11, 2021 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@navmed
Copy link

navmed commented Jan 11, 2021

I'd like to use this as a NestJS app logger as described here: https://github.com/iamolegga/nestjs-pino#usage-as-nestjs-app-logger

How can I specify the log levels and other configuration?

@navmed navmed added the question Further information is requested label Jan 11, 2021
@iamolegga
Copy link
Owner

You can specify log levels via configuration of LoggerModule: https://github.com/iamolegga/nestjs-pino#asynchronous-configuration please see https://github.com/iamolegga/nestjs-pino#configuration-params for more details

@dlecan
Copy link

dlecan commented Feb 5, 2021

Is it level or useLevel?

From https://github.com/iamolegga/nestjs-pino#asynchronous-configuration

         pinoHttp: { level: config.level },

From https://github.com/pinojs/pino-http#pinohttpopts-stream

...
useLevel: the logger level pino-http is using to log out the response. default: info
...

@iamolegga
Copy link
Owner

@dlecan this two different options

useLevel: the logger level pino-http is using to log out the response. default: info

level sets level for logger, so only logs with level >= options.level will be emitted. I recommend read the docs of pino first

@twelve17
Copy link

Also worth noting, the NestJS repl uses its own logger, so the pino logging config does not seem to be used (and hence any logger that might have been specified in that config.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants