Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
Winston not logging correct values

Hey everyone i need help setting up my Winston logging config. I am migrating an existing project with 300 + console.logs to winston and now the values of the logs are not printed anymore. I researched online and only found hacky solutions that didn't work for me. Any help is appreciated.

This is my logger config
    // logger config
    const winston = require('winston')
    const { combine, timestamp, colorize, align, printf } = winston.format
    const logger = winston.createLogger({
      // level: process.env.LOG_LEVEL || 'info',
      level: 'silly',
      format: combine(
        colorize({ all: true }),
        timestamp({
          format: 'YYYY-MM-DD hh:mm:ss',
        }),
        align(),
        printf((info) => `[${info.timestamp}] ${info.level}: ${info.message}`)
      ),  transports: [new winston.transports.Console()],
    })
    module.exports = logger

This is how the console log was before:

console.log('active jobs : ',
              (await queue.getActive()).length)

Output:

active jobs : 12

This is how it is now:

logger.info(
          'active jobs : ',
          (await queue.getActive()).length
        )

Output:

[2022-05-23 03:57:29] info: active jobs :

I would appreciate if there is a possibility without changing the console.logs since they are so many.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda