pinojs / pino-socket

🌲 A transport for sending pino logs to network sockets
43 stars 14 forks source link

Propagate events to the parent port (when using thread-stream) #89

Closed ggrossetie closed 2 years ago

ggrossetie commented 2 years ago

Events sent are already documented: https://github.com/pinojs/pino-socket#events Previously, the following wasn't working:

const transport = pino.transport({
  target: 'pino-socket',
  options: {
    address: '10.10.10.5',
    port: 5000,
    mode: 'tcp'
  }
})
transport.on('reconnectFailure', (error) => {/* do something */})

Now it works! I guess I can add a note to state that events will be propagated from the worker thread to the transport?