Skip to content

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

Open
@ukyanj0

Description

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)

Thank you in advance

logrotate1
logrotate2
logrotate6
logrotate7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions