3

I am following the steps outlined here to configure loggly in my nodejs app :

npm install winston
npm install winston-loggly-bulk

and in index.js :

var winston = require('winston');
require('winston-loggly-bulk');
winston.add(winston.transports.Loggly, {
token: "8ea17e10-bfce-4f78-bc18-51ab6c61f78c",
subdomain: "qbesdeveloper",
tags: ["Winston-NodeJS"],
json:true
});

but I keep getting this error :

Error: Cannot find module 'loggly'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/user/totoapi/node_modules/winston-loggly-bulk/lib/winston-loggly.js:10:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/user/totoapi/index.js:10:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
ShahiM
  • 3,179
  • 1
  • 33
  • 58

2 Answers2

9

Well, I reached out to Loggly support and they gave me a solution:

The docs say to install just winston and winston-loggly-bulk, but you need to install a third packege loggly too.

npm install winston
npm install loggly
npm install winston-loggly-bulk

I have no idea why they did not mention this in their getting started page. Anyways, I'm gonna leave this here until they update their docs.

ShahiM
  • 3,179
  • 1
  • 33
  • 58
  • 1
    Just had the exact same problem, and agree that docs should say it. Asked on twitter if there is a better place to report this https://twitter.com/DinisCruz/status/791933439238746113 – Dinis Cruz Oct 28 '16 at 09:24
1

I just wanted to let you know that we updated our documentation and the instructions are now correct https://www.loggly.com/docs/nodejs-logs/. The maintainer of the original package was not responding to our pull requests so we forked it and created a new package version that allows us to do better quality control and update it faster. Thanks for sending us a tweet.

mostlyjason
  • 138
  • 4