-
Bug
-
Resolution: Fixed
-
Major
-
None
Problem statement
When an error occurs in the backend, the context.error is fully spit into the logs, which results in very verbose logs.
Verbose logs can be fine sometimes, but here I believe this goes too far and has reached a point where it will actually hide the other potential critical logs.
Expected behavior
Logging should provide context and help fix issues. But too much logging actually makes things harder to fix as developers have to basically scroll for hours to find critical lines.
(and create pain in index finger while scrolling, too ).
Examples
Logging during a run through make run (I screwed the UUID on purpose to trigger such stack):
backend_1 | error: { NotAuthenticated: Invalid UUID backend_1 | at new NotAuthenticated (/srv/evergreen/node_modules/@feathersjs/errors/lib/index.js:93:17) backend_1 | at Object.module.exports (/srv/evergreen/src/hooks/ensureuuid.js:48:11) backend_1 | at promise.then.hookObject (/srv/evergreen/node_modules/@feathersjs/feathers/node_modules/@feathersjs/commons/lib/hooks.js:142:73) backend_1 | at <anonymous> backend_1 | at process._tickCallback (internal/process/next_tick.js:182:7) backend_1 | type: 'FeathersError', backend_1 | name: 'NotAuthenticated', backend_1 | message: 'Invalid UUID', backend_1 | code: 401, backend_1 | className: 'not-authenticated', backend_1 | data: undefined, backend_1 | errors: {}, backend_1 | hook: backend_1 | { type: 'before', backend_1 | arguments: [ null, [Object], [Object] ], backend_1 | service: backend_1 | { paginate: false, backend_1 | options: [Object], backend_1 | Model: instances, backend_1 | id: 'uuid', backend_1 | events: [Array], backend_1 | raw: false, backend_1 | docs: [Object], backend_1 | find: [Function: newMethod], backend_1 | get: [Function: newMethod], backend_1 | create: [Function: newMethod], backend_1 | patch: [Function: newMethod], backend_1 | update: [Function: newMethod], backend_1 | remove: [Function: newMethod], backend_1 | methods: [Object], backend_1 | hooks: [Function: hooks], backend_1 | _events: [Object], backend_1 | _eventsCount: 5, backend_1 | _maxListeners: undefined, backend_1 | setMaxListeners: [Function: setMaxListeners], backend_1 | getMaxListeners: [Function: getMaxListeners], backend_1 | emit: [Function: emit], backend_1 | addListener: [Function: addListener], backend_1 | on: [Function: addListener], backend_1 | prependListener: [Function: prependListener], backend_1 | once: [Function: once], backend_1 | prependOnceListener: [Function: prependOnceListener], backend_1 | removeListener: [Function: removeListener], backend_1 | removeAllListeners: [Function: removeAllListeners], backend_1 | listeners: [Function: listeners], backend_1 | rawListeners: [Function: rawListeners], backend_1 | listenerCount: [Function: listenerCount], backend_1 | eventNames: [Function: eventNames], backend_1 | publish: [Function: publish], backend_1 | _super: undefined, backend_1 | [Symbol(@feathersjs/transport-commons/publishers)]: [Object] }, backend_1 | app: backend_1 | { [EventEmitter: app] backend_1 | _events: [Object], backend_1 | _eventsCount: 4, backend_1 | _maxListeners: undefined, backend_1 | setMaxListeners: [Function: setMaxListeners], backend_1 | getMaxListeners: [Function: getMaxListeners], backend_1 | emit: [Function: emit], backend_1 | addListener: [Function: addListener], backend_1 | on: [Function: addListener], backend_1 | prependListener: [Function: prependListener], backend_1 | once: [Function: once], backend_1 | prependOnceListener: [Function: prependOnceListener], backend_1 | removeListener: [Function: removeListener], backend_1 | removeAllListeners: [Function: removeAllListeners], backend_1 | listeners: [Function: listeners], backend_1 | rawListeners: [Function: rawListeners], backend_1 | listenerCount: [Function: listenerCount], backend_1 | eventNames: [Function: eventNames], backend_1 | init: [Function: init], backend_1 | defaultConfiguration: [Function: defaultConfiguration], backend_1 | lazyrouter: [Function: lazyrouter], backend_1 | handle: [Function: handle], backend_1 | use: [Function: newMethod], backend_1 | route: [Function: route], instance_1 | error: Failed to update the Status record with the current level Invalid UUID backend_1 | engine: [Function: engine], backend_1 | param: [Function: param], backend_1 | set: [Function: set], backend_1 | path: [Function: path], backend_1 | enabled: [Function: enabled], backend_1 | disabled: [Function: disabled], backend_1 | enable: [Function: enable], backend_1 | disable: [Function: disable], backend_1 | acl: [Function], backend_1 | bind: [Function], backend_1 | checkout: [Function], backend_1 | connect: [Function], backend_1 | copy: [Function], backend_1 | delete: [Function], backend_1 | get: [Function], backend_1 | head: [Function], backend_1 | link: [Function], backend_1 | lock: [Function], backend_1 | 'm-search': [Function], backend_1 | merge: [Function], backend_1 | mkactivity: [Function], backend_1 | mkcalendar: [Function], backend_1 | mkcol: [Function], backend_1 | move: [Function], backend_1 | notify: [Function], backend_1 | options: [Function], backend_1 | patch: [Function], backend_1 | post: [Function], backend_1 | propfind: [Function], backend_1 | proppatch: [Function], backend_1 | purge: [Function], backend_1 | put: [Function], backend_1 | rebind: [Function], backend_1 | report: [Function], backend_1 | search: [Function], backend_1 | source: [Function], backend_1 | subscribe: [Function], backend_1 | trace: [Function], backend_1 | unbind: [Function], backend_1 | unlink: [Function], backend_1 | unlock: [Function], backend_1 | unsubscribe: [Function], backend_1 | all: [Function: all], backend_1 | del: [Function], backend_1 | render: [Function: render], backend_1 | listen: [Function: newMethod], backend_1 | request: [IncomingMessage], backend_1 | response: [ServerResponse], backend_1 | cache: {}, backend_1 | engines: {}, backend_1 | settings: [Object], backend_1 | locals: [Object], backend_1 | mountpath: '/', backend_1 | configure: [Function: configure], backend_1 | service: [Function: service], backend_1 | setup: [Function], backend_1 | version: '3.2.3', backend_1 | methods: [Array], backend_1 | mixins: [Array], backend_1 | services: [Object], backend_1 | providers: [Array], backend_1 | _setup: false, backend_1 | hookTypes: [Array], backend_1 | hooks: [Function: hooks], backend_1 | eventMappings: [Object], backend_1 | _super: undefined, backend_1 | _router: [Function], backend_1 | rest: [Object], backend_1 | channel: [Function: channel], backend_1 | publish: [Function: publish], backend_1 | lookup: [Function: lookup], backend_1 | passport: [Authenticator], backend_1 | authenticate: [Function: bound ], backend_1 | docs: [Object], backend_1 | io: [Server], backend_1 | _isSetup: true, backend_1 | [Symbol(@feathersjs/transport-commons/channels)]: [Object], backend_1 | [Symbol(@feathersjs/transport-commons/publishers)]: [Object], backend_1 | [Symbol(@feathersjs/transport-commons/router)]: [Object] }, backend_1 | method: 'patch', backend_1 | path: 'status', backend_1 | id: null, backend_1 | data: { uuid: '4557b0c1-6f0e-401c-8580-9cdf9300dbfcg', updateId: 2 }, backend_1 | params: backend_1 | { query: [Object], backend_1 | route: {}, backend_1 | connection: [Object], backend_1 | provider: 'socketio', backend_1 | payload: [Object], backend_1 | user: [Object], backend_1 | accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJ1c2VySWQiOjEsImlhdCI6MTUzNzg4MDg3MiwiZXhwIjoxNTM3OTY3MjcyLCJhdWQiOiJodHRwczovL3lvdXJkb21haW4uY29tIiwiaXNzIjoiZmVhdGhlcnMiLCJzdWIiOiJhbm9ueW1vdXMiLCJqdGkiOiIyYzM1OTgwOC1jY2MwLTRlMDUtOWYzNi03NjA4MDQ4NjI0NGYifQ.h15cWycR67P6vM7979nj1GfATcQGQthKriaCURUPhmM', backend_1 | headers: [Object], backend_1 | authenticated: true } } }
Typical logs during acceptance tests:
BadRequest { type: 'FeathersError', name: 'BadRequest', message: 'Client must provide a curve with the request', code: 400, className: 'bad-request', data: undefined, errors: {}, hook: { data: { pubKey: 'pretend-pubkey' }, params: { query: {}, route: {}, provider: 'rest', headers: [Object] }, type: 'before', service: { paginate: [Object], options: [Object], Model: registrations, id: 'id', events: undefined, raw: true, docs: [Object], find: [Function: newMethod], get: [Function: newMethod], create: [Function: newMethod], patch: [Function: newMethod], update: [Function: newMethod], remove: [Function: newMethod], hooks: [Function: hooks], _events: [Object], _eventsCount: 4, _maxListeners: undefined, setMaxListeners: [Function: setMaxListeners], getMaxListeners: [Function: getMaxListeners], emit: [Function], addListener: [Function: addListener], on: [Function: addListener], prependListener: [Function: prependListener], once: [Function: once], prependOnceListener: [Function: prependOnceListener], removeListener: [Function: removeListener], off: [Function: removeListener], removeAllListeners: [Function: removeAllListeners], listeners: [Function: listeners], rawListeners: [Function: rawListeners], listenerCount: [Function: listenerCount], eventNames: [Function: eventNames], publish: [Function: publish], _super: undefined, [Symbol(@feathersjs/transport-commons/publishers)]: {} }, app: { [EventEmitter: app] _events: [Object], _eventsCount: 4, _maxListeners: undefined, setMaxListeners: [Function: setMaxListeners], getMaxListeners: [Function: getMaxListeners], emit: [Function], addListener: [Function: addListener], on: [Function: addListener], prependListener: [Function: prependListener], once: [Function: once], prependOnceListener: [Function: prependOnceListener], removeListener: [Function: removeListener], off: [Function: removeListener], removeAllListeners: [Function: removeAllListeners], listeners: [Function: listeners], rawListeners: [Function: rawListeners], listenerCount: [Function: listenerCount], eventNames: [Function: eventNames], init: [Function: init], defaultConfiguration: [Function: defaultConfiguration], lazyrouter: [Function: lazyrouter], handle: [Function: handle], use: [Function: newMethod], route: [Function: route], engine: [Function: engine], param: [Function: param], set: [Function: set], path: [Function: path], enabled: [Function: enabled], disabled: [Function: disabled], enable: [Function: enable], disable: [Function: disable], acl: [Function], bind: [Function], checkout: [Function], connect: [Function], copy: [Function], delete: [Function], get: [Function], head: [Function], link: [Function], lock: [Function], 'm-search': [Function], merge: [Function], mkactivity: [Function], mkcalendar: [Function], mkcol: [Function], move: [Function], notify: [Function], options: [Function], patch: [Function], post: [Function], propfind: [Function], proppatch: [Function], purge: [Function], put: [Function], rebind: [Function], report: [Function], search: [Function], source: [Function], subscribe: [Function], trace: [Function], unbind: [Function], unlink: [Function], unlock: [Function], unsubscribe: [Function], all: [Function: all], del: [Function], render: [Function: render], listen: [Function: newMethod], request: [IncomingMessage], response: [ServerResponse], cache: {}, engines: {}, settings: [Object], locals: [Object], mountpath: '/', configure: [Function: configure], service: [Function: service], setup: [Function], version: '3.1.7', methods: [Array], mixins: [Array], services: [Object], providers: [Array], _setup: false, hookTypes: [Array], hooks: [Function: hooks], eventMappings: [Object], _super: undefined, _router: [Function], rest: [Object], channel: [Function: channel], publish: [Function: publish], lookup: [Function: lookup], passport: [Authenticator], authenticate: [Function: bound ], docs: [Object], io: [Server], _isSetup: true, [Symbol(@feathersjs/transport-commons/channels)]: [Object], [Symbol(@feathersjs/transport-commons/publishers)]: [Object], [Symbol(@feathersjs/transport-commons/router)]: [Object] }, method: 'create', path: 'registration' } }
- links to