我正在按照此处概述的步骤在我的 nodejs 应用程序中配置 loggly:
npm install winston
npm install winston-loggly-bulk
在 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
});
但我不断收到此错误:
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)