pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

Logs cut off when using async logging + cluster on high traffic #1562

Closed yukha-dw closed 2 years ago

yukha-dw commented 2 years ago

Hello, i want to report similar issue as #1261. I'm using pino 8.50 + sonic-boom 3.1.0.

The problem occurs when more than one child processes are printing logs using async logging method.

Update: The problem only occurs when running inside docker container.

I've also tested it with simple app to spam logs:

for (let i = 0; i < 100000; ++i) {
        app.log.info(
          {
            i,
            flagA: "flagAIsAtomic",
            flagB: "flagBIsAtomic",
            flagC: "flagCIsAtomic",
            flagD: "flagDIsAtomic",
            flagE: "flagEIsAtomic",
          },
          "hello world"
        );
      }

and some of the logs are cut off: image

I've posted the fastify app to reproduce this issue, all you need is

yukha-dw commented 2 years ago

I think this issue has something to do with how docker logs the file. I will re-run the test without docker

Update: It turns out the problem only occurs when running inside docker container. I'll close the issue if there's nothing to fix on pino.

yukha-dw commented 2 years ago

After further investigating, i've concluded default value of maxWrite (16KB) is too big when run inside docker (docker is also limited to 16KB https://github.com/pinojs/sonic-boom/pull/137).

Reducing maxWrite values fixes my issue.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.