winston.createLogger is not a function
See original GitHub issueHi,
I just install winston 2.4.0 and testing it. Here is my code:
var winston = require('winston');
require('winston-daily-rotate-file');
exports.logger = winston.createLogger({
level: 'silly',
transports: [
new winston.transports.Console({
level: process.env.ENVIRONMENT === 'development' ? 'silly' : 'info'
}),
new winston.transports.DailyRotateFile({
filename: '../logs',
datePattern: 'dd-MM-yyyy.',
prepend: true,
level: process.env.ENVIRONMENT === 'development' ? 'debug' : 'info'
})
],
exitOnError: false
});
When I run it throws error: “TypeError: winston.createLogger is not a function”
Using default logger is OK, for example:
winston.log('info', 'Hello');
Did I miss something?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:8 (2 by maintainers)
Top Results From Across the Web
TypeError: winston.createLogger is not a constructor
The application works fine on my local machine and the problem only occurs on the EC2 instance running Amazon Linux AMI 2. Winston...
Read more >How to use the winston.createLogger function in winston - Snyk
To help you get started, we've selected a few winston.createLogger examples, based on popular ways it is used in public projects.
Read more >winston - npm
The simplest way to do this is using winston.createLogger : const winston = require('winston'); const logger = winston.
Read more >winstonjs/winston - Gitter
Is everybody installing winston by using github master? ... _addDefaultMeta is not a function"error anymore? ... Here is my createLogger config.
Read more >logging in JavaScript with Winston.js - ZetCode
Logging is not limited to identifying errors in software development. ... A winston logger is created with the createLogger function.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d like to second that I also ran into this. The Readme should definitely make it clear that the docs are for the release candidate.
Also, thanks for maintaining winston, logging is such a headache.
Same for me. I find it rather odd that you show documentation in your README for a release candidate.