Complete the code to import the Winston logger in a NestJS service.
import { Logger } from '[1]';
Winston is imported from the 'winston' package to use its logging features.
Complete the code to create a Winston logger instance with console transport.
const logger = winston.createLogger({ transports: [new winston.transports.[1]()] });The Console transport outputs logs to the console, which is common for development.
Fix the error in the NestJS logger injection code.
constructor(private readonly logger: [1]) {}In NestJS, the Logger class is used for logging and can be injected as a service.
Fill both blanks to configure Pino logger with pretty print and level 'debug'.
const logger = pino({ level: '[1]', transport: { target: '[2]' } });The level 'debug' enables detailed logs. The 'pino-pretty' target formats logs nicely for console.
Fill all three blanks to create a Winston logger with JSON format, timestamp, and console transport.
const logger = winston.createLogger({ format: winston.format.combine(winston.format.[2](), winston.format.[1]()), transports: [new winston.transports.[3]()] });Combining json format with timestamp adds time info to logs. Console transport outputs logs to terminal.