Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see console.log output when running a NestJS app?

I'm building my first NestJS app and I see a lot of examples in their docs that use console.log(), but when I add it, there's no output in the terminal. I'm using vscode's terminal.

I've also tried using the built-in Logger and start the app using npm run start:debug, and I see no output from the Logger either. I know that it's reaching my controller because I'm getting a response. Does anyone know what the issue could be?

like image 526
u84six Avatar asked Dec 03 '25 07:12

u84six


1 Answers

you better use Logger instead of console.

import { Logger } from '@nestjs/common';

Logger.log('info')
Logger.warn('warning')
Logger.error('something went wrong! ', error)
like image 189
Gian Ramirez Avatar answered Dec 04 '25 21:12

Gian Ramirez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!