I'm using winston-elasticsearch on an express server, I just wrote the same code as in the documentation
var winston = require('winston');
var Elasticsearch = require('winston-elasticsearch');
var esTransportOpts = {
level: 'info'
};
var logger = winston.createLogger({
transports: [
new Elasticsearch(esTransportOpts)
]
});
when i run the server, I get this error:
TypeError: Elasticsearch is not a constructor
I have installed the lates versions "winston": "^3.2.1" and "winston-elasticsearch": "^0.8.8"
For Winston 3.x, Elasticsearch 6.0 and later, use the 0.7.0. For Elasticsearch 6.0 and later, use the 0.6.0. For Elasticsearch 5.0 and later, use the 0.5.9. For earlier versions, use the 0.4.x series.