hapijs / good

hapi process monitoring
Other
525 stars 161 forks source link

Constructor error in rotating-file-stream #588

Closed unagi2020 closed 6 years ago

unagi2020 commented 6 years ago

I am getting following error when using rotating-file-stream

Error: Error in file. rotating-file-stream must be a constructor function.
    at Object.exports.assert (/home/hapi/node_modules/hoek/lib/index.js:740:11)
    at internals.forOwn (/home/hapi/node_modules/good/lib/monitor.js:131:22)
    at Object.internals.forOwn (/home/hapi/node_modules/good/lib/monitor.js:232:9)
    at Monitor.start (/home/hapi/node_modules/good/lib/monitor.js:105:19)
    at Object.exports.register (/home/hapi/node_modules/good/lib/index.js:42:20)
    at Object.target [as register] (/home/hapi/node_modules/joi/lib/types/object/index.js:77:34)
    at each (/home/hapi/node_modules/hapi/lib/plugin.js:310:14)
    at iterate (/home/hapi/node_modules/items/lib/index.js:36:13)
    at Object.exports.serial (/home/hapi/node_modules/items/lib/index.js:39:9)
    at module.exports.internals.Plugin.internals.Plugin.register (/home/hapi/node_modules/hapi/lib/plugin.js:313:11)
    at Object.exports.register (/home/hapi/server/config/log.js:41:10)
    at Object.target [as register] (/home/hapi/node_modules/joi/lib/types/object/index.js:77:34)
    at each (/home/hapi/node_modules/hapi/lib/plugin.js:310:14)
    at iterate (/home/hapi/node_modules/items/lib/index.js:36:13)
    at Object.exports.serial (/home/hapi/node_modules/items/lib/index.js:39:9)
    at module.exports.internals.Server.internals.Plugin.register (/home/hapi/node_modules/hapi/lib/plugin.js:313:11)
    at Object.<anonymous> (/home/hapi/server/server.js:307:8)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)

config

  const options  = {
    ops: {
      interval: 1000
    },
    reporters: {
      file: [{
        module: 'good-squeeze',
        name: 'Squeeze',
        args: [{log: '*', response: '*', request: '*'}]
      }, {
        module: 'good-squeeze',
        name: 'SafeJson',
        args: [{seperator: '\n'}]
      }, {
        module: 'rotating-file-stream',
        args: ['hapi.log', {
          path: './logs',
          size: '10M'
        }]
      }]
    }
  }

components

    "hapi": "^16.5.2",
    "good": "^7.3.0",
    "good-logstash": "^2.0.2",
    "good-squeeze": "^5.0.2",
    "rotating-file-stream": "^1.3.5",
unagi2020 commented 6 years ago

Error went away when i removed name: 'RotatingFileStream', Sorry was looking at wrong implementation.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.