Search code examples
nestjs

How do I replace the 'Nest' text with my own application name when logging?


The standard logging output with NestJS looks as follows:

[Nest] 1  - 01/01/2022, 2:54:40 PM     LOG [Main] Listening for HTTP requests on port 3000

Each line starts with '[Nest]'. Can I replace that with my own application name? If so how?


Solution

  • You'll need to use a custom logger for this. Either extending Nest's own or using a pre-built solution like ogma, pino, or winston