Skip to content

Sails 0.12 obviously not compatible with Winston 3.0 #4337

Description

@egomezr

Sails version: 0.12.13
Node version: 6.10.2
NPM version: 3.10.10
DB adapter name: N/A
DB adapter version: N/A
Operating system: Ubuntu 16.04


I'm unable to run Sails along with Winston. Looks that Sails is executing a sort of binding.

The main error is:
Uncaught TypeError: this.write is not a function

I found a workaround doing the following:

let winstonLogger = createLogger(loggerSettings);
let logger = {
    'info': function () {
        winstonLogger.info(...arguments);
    },
    'debug': function () {
        winstonLogger.debug(...arguments);
    },
    'error': function () {
        winstonLogger.error(...arguments);
    },
    'warn': function () {
        winstonLogger.warn(...arguments);
    },
    'log': function () {
        winstonLogger.log(...arguments);
    }
};
// End of workaround

module.exports.log = {
    custom: logger,
    inspect: false
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions