To use Node Nest.js Logging service, we use the Logger
constructor.
For instance, we write
@Controller()
export class AppController {
private readonly logger = new Logger(AppController.name);
@Get()
async get() {
this.logger.log("Getting stuff");
}
}
to create a Logger
object with the name
of the controller.
Then we call logger.log
to log some text.