У меня есть приложение для узлов, которое использует безсерверную инфраструктуру aws.
По какой-то причине pino не отображает \n
символов.
Мои журналы выглядят примерно так (обратите внимание на \n
в форматировании блока кода):
{"level":50,"time":1552066634989,"msg":"Standard Error - Exception","pid":15143,"hostname":"some_host","type":"Error","stack":"TypeError: Cannot set property 'message' of undefined\n at Object.create (/some_path/node_modules/common-backend/lib/helpers/responses/error.js:63:25)\n at dbInstance.sequelize.transaction.then.catch (/some_path/src/handlers/drone/create.js:28:37)\n at tryCatcher (/some_path/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/some_path/node_modules/bluebird/js/release/promise.js:512:31)\n at Promise._settlePromise (/some_path/node_modules/bluebird/js/release/promise.js:569:18)\n at Promise._settlePromise0 (/some_path/node_modules/bluebird/js/release/promise.js:614:10)\n at Promise._settlePromises (/some_path/node_modules/bluebird/js/release/promise.js:690:18)\n at _drainQueueStep (/some_path/node_modules/bluebird/js/release/async.js:138:12)\n at _drainQueue (/some_path/node_modules/bluebird/js/release/async.js:131:9)\n at Async._drainQueues (/some_path/node_modules/bluebird/js/release/async.js:147:5)\n at Immediate.Async.drainQueues (/some_path/node_modules/bluebird/js/release/async.js:17:14)\n at runCallback (timers.js:672:20)\n at tryOnImmediate (timers.js:645:5)\n at processImmediate [as _immediateCallback] (timers.js:617:5)","v":1}
вместо
{"level":50,"time":1552066634989,"msg":"Standard Error - Exception","pid":15143,"hostname":"some_host","type":"Error","stack":"TypeError: Cannot set property 'message' of undefined
at Object.create (/some_path/node_modules/common-backend/lib/helpers/responses/error.js:63:25)
at dbInstance.sequelize.transaction.then.catch (/some_path/src/handlers/drone/create.js:28:37)
at tryCatcher (/some_path/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/some_path/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/some_path/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromise0 (/some_path/node_modules/bluebird/js/release/promise.js:614:10)
at Promise._settlePromises (/some_path/node_modules/bluebird/js/release/promise.js:690:18)
at _drainQueueStep (/some_path/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/some_path/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/some_path/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues (/some_path/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:672:20)
at tryOnImmediate (timers.js:645:5)
at processImmediate [as _immediateCallback] (timers.js:617:5)","v":1}