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

164
Views
custom transport for winston DailyRotateFile to seperate log files

As you know default behavior of winston logger is to log all the messages which have at least the specifies importance aka logging level. But i want to completely separate log files.

For example:

logger.error("error happened") ->naturally this logs to all level log files. according to my requirements this must only log to error log file. not to debug log file.

I have found some tricks to overcome this behavior. As a solution using customTransform implementation suggested. But the suggested implementation was for a single console logger transform (here)

These are my transports.

var transportError = new winston.transports.DailyRotateFile({
  filename: frontendErrorLogFile,
  level: "error"
  });
var transportApi = new winston.transports.DailyRotateFile({
  filename: frontendApiLogFile,
  level: "info"
  });

var logger = winston.createLogger({
    transports: [
      transport,
      transportError,
      transportApi
    ]
});

Could you please help me in designing a custom transport for two DailyRotateFile's.

about 4 years ago · Juan Pablo Isaza
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!