winstonjs / winston

A logger for just about everything.
http://github.com/winstonjs/winston
MIT License
22.55k stars 1.8k forks source link

[Bug]: truncated JSON object in log output #2347

Open KernelDeimos opened 11 months ago

KernelDeimos commented 11 months ago

🔎 Search Terms

truncated, cut-off, incomplete

The problem

On a prod server I'm seeing an incomplete JSON object at the end of a log. This was after an error occurred, and part of the error was logged. The error in particular originated from axios, but tests with this same error before did not produce this issue, so it might be stochastic or due to conditions of the environment.

After the incomplete error was logged, no further logs were logged.

This is the last line of output:

{"label":"process-event-service","level":"error","message":"Error @ process:unhandledRejection: connect ECONNREFUSED 127.0.0.1:3101; Error: connect ECONNREFUSED 127.0.0.1:3101\n    at AxiosError.from (/opt/puter/green/dist/node_modules/axios

What version of Winston presents the issue?

v3.9.0

What version of Node are you using?

v20.3.1

If this worked in a previous version of Winston, which was it?

No response

Minimum Working Example

No response

Additional information

No response

KernelDeimos commented 11 months ago

It happened again, this time with a different log message:

{"label":"morgan","level":"info","message":"GET / 200 1.787\n","method":

This was likely happening more in the past before I noticed. I'll do a complete analysis of the logs when I get a chance. If it was happening before it means it's possible that logging resumes once rotation occurs.

I think this rules out the contents of the log causing the issue, since this is a very different log and also a simpler one. I also verified that the server has ample free drive space.