Skip to content

this._addDefaultMeta is not a function #1577

Description

@errietta

Please tell us about your environment:

  • winston version?
    • winston@2
    • winston@3
  • node -v outputs: 8.9.3
  • _Operating System? Linux & Mac
  • Language? Es6

What is the problem?

Since the 3.2.0 release we are getting the following:

error: this._addDefaultMeta is not a function {"stack":"TypeError: this._addDefaultMeta is not a function\n    at APIClient.(anonymous function) [as logger] (/Users/erriettakostala/prototype1/server/node_modules/winston/lib/winston/create-logger.js:55:16)\n  

We're just calling log the same way as before.

  const logger = winston.createLogger({
    level: process.env.LOG_LEVEL || 'debug',
    format: process.env.NODE_ENV === 'production' ? winston.format.json() : winston.format.simple(),
    transports: [ new winston.transports.Console() ]
  })

logger.log({
  level: 'info',
  message: ''
});

What do you expect to happen instead?

The code to not crash :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions