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

209
Views
Migrate to winston 3 and Extend winston logger

I want to extend the Winston logger to my custom logger. Where I updated the log method before calling the internal method.

For Winston version 2.4.x I did this.

var winston = require("winston");

var Logger = function(options){
  Logger.super_.apply(this, arguments);
}
util.inherits(Logger, winston.Logger);

Logger.prototype.log = function () {

  //some logic

  Logger.super_.prototype.log.apply(this, args);

};

Now, I am migrating to the Winston version 3.x.x

I migrated the above code as

class Logger extends winston.createLogger {

  constructor(options) {
    super(options);
  }

  log() {

    //some logic

    super.log(args);
  };
}

The above code is able to create an instance of the logger and start logging the logs but it is not calling my log method instead it's only calling the inbuild Winston log method.

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!