Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!