Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs more than 2 years before are included into current daily logs with huge sizes #5803

Open
ukyanj0 opened this issue Apr 19, 2024 · 1 comment

Comments

@ukyanj0
Copy link

ukyanj0 commented Apr 19, 2024

What's going wrong?

Logs more than 2 years before are included into current daily logs with huge sizes

How could we reproduce this issue?

May not be a reproducible if issue, just wondered if this kind of issue had been reported before that it show a specific pattern.

Supporting information

Hello, last week our logrotate show too much CPU usage > 130% so we should have stopped using it.
It has worked fine for months with daily logging option, with less than 10MB size for a log.
The conf is
max_size 10M
retain 30
compress false
dateFormat YYYY-MM-DD_HH-mm-ss x
workerInterval 30
rotateInterval 0 0 * * *
rotateModule true

Analyzing error logs, I have found some odds that I want to ask the developers' opinions.

  1. PM2 logrotate started creating logs that include the oldest logs up to 2 years before, where the PM2 daemon starting working. The start time was around 4/15/24 16:31:02 as shown in the file name. (first photo)
  2. The first out.log size was created 4/15/24 16:31:02 with 3.6G that includes logs between 2022 Jan ~ 2023 Oct, then the second out.log was created 30 seconds later 4/15/24 16:31:32 with 3.4G that includes logs between 2022 Jan ~ 2023 Sep, which is shorter term than the first one. (second photo)
  3. Then for the next ones, it has the same pattern as 1) in 30 seconds 2), for shorter term, 3) therefore with 0.2G less size. (second photo)
  4. What I found weird was that in the head of monproxy-error__2024-04-15_16-31-02.log file, that is one of very first error files, I could read the "Cannot set property 'time' of null" error, which had tried to set the time of system info. There I guess they might have failed to read the process/server system info, then they failed to set the time of the system info that might end up being bugs of logrotate. (last two photos)

logrotate1
logrotate2
logrotate6
logrotate7

# Run the following commands
$ pm2 report

Thank you in advance.
Luke

@millette
Copy link

See https://github.com/Unitech/pm2/tree/master?tab=readme-ov-file#log-management, specifically the big about pm2-logrotate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants