Closed iprunache closed 7 years ago
duplicated by https://github.com/NRGI/rgi-assessment-tool/issues/572
@alexander-elgin I'll reopen this until all logs are written to stdout and are collected with Papertrail. This means removing the logger
all over the code and replacing it with logging to stdout
- Bunyan is fine.
But be aware that either writing to stderr or through Bunyan has generated an error when logging. So let's also write to stdout
and not stderr
.
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: {"name":"Invalid_Key","hostname":"f556e822a289","pid":15,"level":50,"status":"error","code":-1,"message":"Invalid API key","msg":"","time":"2016-11-24T07:57:46.847Z","v":0}
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: events.js:141
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: throw er; // Unhandled 'error' event
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: ^
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: ValidationError: Log validation failed
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at MongooseError.ValidationError (/src/node_modules/mongoose/lib/error/validation.js:23:11)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at model.Document.invalidate (/src/node_modules/mongoose/lib/document.js:1473:32)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at /src/node_modules/mongoose/lib/document.js:1349:17
Nov 24 09:57:46 50c7681a194a ecs-rgi-staging-task-59-rgi-staging-container-8cd9ff8d83dcfdbb01: GET /favicon.ico 304 23.560 ms - -
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at validate (/src/node_modules/mongoose/lib/schematype.js:705:7)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at /src/node_modules/mongoose/lib/schematype.js:742:9
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at Array.forEach (native)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at SchemaString.SchemaType.doValidate (/src/node_modules/mongoose/lib/schematype.js:710:19)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at /src/node_modules/mongoose/lib/document.js:1347:9
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at nextTickCallbackWith0Args (node.js:436:9)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: at process._tickDomainCallback [as _tickCallback] (node.js:406:13)
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: error: Forever detected script exited with code: 1
Nov 24 09:57:46 f556e822a289 ecs-rgi-staging-task-59-rgi-staging-container-9efbdf91e3adc3a39b: error: Script restart attempt #1
Why
We need a reliable process of generating logs all over the app and collecting them to a single storage so that we can easily follow up events.
We are now collecting stdout and error logs with Papertrail so all logs should go to those 2 streams.
What
Notes