Closed meotimdihia closed 4 years ago
Another bug is Bree not work good with Pino:
const bree = new Bree({
logger: pino
....
example:
{"level":30,"time":1600514925288,"pid":11138,"hostname":"ip-10-0-0-21","msg":"Worker for job \"test\" online"} {"level":50,"time":1600514925658,"pid":11138,"hostname":"ip-10-0-0-21","msg":"Worker for job \"test\" had an error"} {"level":50,"time":1600514925673,"pid":11138,"hostname":"ip-10-0-0-21","msg":"Worker for job \"test\" exited with code 1"}
Stacktrace is completely missing from logs. Full logs:
Worker for job "test" had an error {
err: Error: final requires a stream that has a flushSync method, such as pino.destination and pino.extreme
at Function.final...
......
You should use it like this:
const pino = require('pino')({
customLevels: {
log: 30
},
hooks: {
// <https://github.com/pinojs/pino/blob/master/docs/api.md#logmethod>
logMethod(inputArgs, method) {
return method.call(this, {
// <https://github.com/pinojs/pino/issues/854>
// message: inputArgs[0],
msg: inputArgs[0],
meta: inputArgs[1]
});
}
}
});
See https://cabinjs.com for further reference.
in
jobs/test.js
:err: Error: final requires a stream that has a flushSync method, such as pino.destination and pino.extreme
I think the issue was related to this: https://github.com/pinojs/pino/issues/761