You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added the module to my new project: npm install sails-hook-bunyan --save
Created a file "config/bunyan.js" as is on README but changed level to 'debug':
var bunyan = require('sails-hook-bunyan');
module.exports.bunyan = {
/** If true, a child logger is injected on each request */
injectRequestLogger: true,
/** If true, log uncaughtExceptions and terminate the process */
logUncaughtException: false,
/** If given, signal to listen on for file rotation */
rotationSignal: null,
/** Convenience setting to log to file */
filePath: null,
logger: {
/** Logger name */
name: 'sails',
/** Bunyan logging level; defaults to info */
level: 'debug',
/** Bunyan serializers */
serializers: bunyan.stdSerializers,
/** Array of output streams */
streams: null
}
};
Ran sails lift.
I get the following output:
info: Starting app...
info: Initializing project hook... (`api/hooks/custom/`)
info: Initializing `apianalytics` hook... (requests to monitored routes will be
logged!)
{"name":"sails","hostname":"hostname.local","pid":63410,"leve
l":30,"msg":"\u001b[36m\u001b[1m·• \u001b[22m\u001b[39m\u001b[1mAuto-migrating...
\u001b[22m\u001b[0m (alter)\u001b[0m","time":"2020-02-10T23:05:23.409Z","v":0}
{"name":"sails","hostname":"hostname.local","pid":63410,"leve
l":30,"msg":" \u001b[90mHold tight, this could take a moment.\u001b[39m","time"
:"2020-02-10T23:05:23.410Z","v":0}
{"name":"sails","hostname":"hostname.local","pid":63410,"leve
l":30,"msg":" ✓ Auto-migration complete.","time":"2020-02-10T23:05:23.521Z","v":0
}
/Users/xyz/Desktop/trial/t2/node_modules/sails-hook-orm/lib/initialize.js:461
sails.log.blank();
^
TypeError: sails.log.blank is not a function
at /Users/xyz/Desktop/trial/t2/node_modules/sails-hook-orm/lib/initialize.
js:461:21
at /Users/xyz/Desktop/trial/t2/node_modules/sails-hook-orm/lib/build-ontol
ogy-and-run-auto-migrations.js:135:14
at afterMigrate (/Users/xyz/Desktop/trial/t2/node_modules/waterline-utils/
lib/auto-migrations/private/run-alter-strategy/index.js:212:12)
at /Users/xyz/Desktop/trial/t2/node_modules/waterline-utils/node_modules/a
sync/dist/async.js:952:25
and the application stops running. I get the same output even without a "config/bunyan.js" file.
Any advice would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered:
I haven't done much with Sails.js in years, and certainly haven't done any testing with Sails 1.0. Looks like Sails added a new method to their default logger that's not in this hook.
I'd gladly accept a PR and post a release if someone's interested enough to fix the issue. Writing a unit test for the fix would even be more awesomer.
I added the module to my new project:
npm install sails-hook-bunyan --save
Created a file "config/bunyan.js" as is on README but changed level to 'debug':
Ran
sails lift
.I get the following output:
and the application stops running. I get the same output even without a "config/bunyan.js" file.
Any advice would be appreciated. Thanks!
The text was updated successfully, but these errors were encountered: