-
Notifications
You must be signed in to change notification settings - Fork 66
TypeError: _winston2.default.transports.Logdna is not a constructor #13
Comments
Hi @danawoodman, thanks for the feedback. The assumption was that you would also require the logdna module, when using Winston. I should make this more clear and I have updated the README accordingly. Thanks for helping us improve the documentation! |
@respectus I attempted that as well but it did not fix the issue for me. Are you sure that works? |
@danawoodman Yes, I can confirm that this fixes the issue. Would you like to send me the file you are using to test? Here is my configuration: var logdna = require('logdna');
var winston = require('winston');
var options = {
key: 'YOUR KEY'
, hostname: 'test'
, app: 'anotherApp'
};
// Defaults to false, when true ensures meta object will be searchable
options.index_meta = true;
// Only add this line in order to track exceptions
options.handleExceptions = true;
winston.add(winston.transports.Logdna, options);
winston.log('error', 'Hello again distributed logs');
winston.log('info', 'HELLOHELLO');
// winston.info('TESTEST');
// winston.warn('TESTEST2'); |
Strange, this is what I get:
Perhaps it has to do with Babel reordering imports or something? |
@danawoodman Hmm yes this seems to be a strange issue. If the settings you described above in your first comment work well for you, I'll gladly add it to the README with a note about differing configurations. To investigate the issue further could you confirm you have winston version 2.2.0 running? I found a similar issue here: winstonjs/winston-loggly#42 |
If you follow the readme to setup with Winston it fails with:
TypeError: _winston2.default.transports.Logdna is not a constructor
Instead, one should import the constructor and use that:
The readme should probably be updated accordingly?
The text was updated successfully, but these errors were encountered: