Hi,
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?
Use used the documentation for [email protected] instead of [email protected].
See the documentation for winston2 here:
https://github.com/winstonjs/winston/tree/2.4.0
Or install winston3 using:
npm i winston@next --save
You helped me there. I did not notice this.
Thanks.
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.
Just copied createLogger example and got several undefined errors! Then googled and found out it's poor documentation :(
Same for me.
I find it rather odd that you show documentation in your README for a release candidate.
Normally I'd read this and move along. but like everyone else im think "what on earth is going on here?"
default docs for a beta version??!?!?!
this was def a problem i had and was unaware of until reading this thread
there should be a branch (perhaps, called Next) which has the new docs etc etc..... the default branch should be whatever is in production
With all the comments here, you'd think this would be fixed, but im still having the issues and even setting the option for the Alias didnt fix it.
Like many of the people here im pretty new to all of this so i could easily be overlooking things, but after reading this thread im fairly confident the issue isnt on my end
I assumed that the documentation was actually for, you know, the current version, so I gave up on winston. None of the examples worked.
Howdy folks. This is clearly explained in the top of README.md. 3.0.0 will be shipping at the end of the month. Appreciate your patience.
Most helpful comment
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.