Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda