trentm/node-bunyan

TypeError in RotatingFileStream

tom-thorne opened this issue · 0 comments

"bunyan": "1.8.12",
Mac OSX 10.14.6
VS Code 1.47.3
Node 12.18.1

Logger option

                streams: [
                    {
                        level: logLevel,
                        type: 'rotating-file',
                        path: path.join(logDir, logfileName),
                        period: '1h',
                        count: 2
                    }
                ]

Occasionally I see this error when starting:

/Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1359
    if (typeof (this.timeout.unref) === 'function') {
                             ^

TypeError: Cannot read property 'unref' of undefined
    at RotatingFileStream.Object.<anonymous>.RotatingFileStream._setRotationTimer (/Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1359:30)
    at RotatingFileStream.Object.<anonymous>.RotatingFileStream._setupNextRot (/Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1341:10)
    at finish (/Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1523:14)
    at moves (/Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1487:20)
    at /Users/tomthorne/code/order/node_modules/bunyan/lib/bunyan.js:1505:25
    at /Users/tomthorne/code/order/node_modules/mv/index.js:34:26
    at FSReqCallback.oncomplete (fs.js:155:23)