pinojs / pino-socket

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

Unable to get udp working #41

Closed bmaupin closed 3 years ago

bmaupin commented 3 years ago

I have the following test code:

'use strict';

const pino = require('pino');
const transports = pino.transport({
  targets: [
    {
      target: 'pino-socket',
      options: {
        address: '127.0.0.1',
        port: 5140,
        mode: 'udp',
      },
    },
  ],
});
const logger = pino(transports);

logger.error('Test message');

If I start up netcat to dump the messages, I don't get anything:

$ nc -klu 5140

However, if I switch mode to tcp and use netcat to dump tcp messages, the log shows up:

$ nc -kl 5140
{"level":50,"time":1632855456630,"pid":216531,"hostname":"workstation","msg":"Test message"}

I'm using these versions:

    "pino": "^7.0.0-rc.7",
    "pino-socket": "^4.0.0",

Thanks!

mcollina commented 3 years ago

cc @Eomm