Cardano-node: LogRotation not working as expected

Created on 18 May 2020  路  11Comments  路  Source: input-output-hk/cardano-node

config files templates like https://github.com/input-output-hk/cardano-node/blob/master/configuration/defaults/byron-mainnet/configuration.yaml#L136 suggest

rotation:
  rpLogLimitBytes: 10000000
  rpKeepFilesNum:  10
  rpMaxAgeHours:   24

the rpLogLimitBytes key seems to work as logfiles are created at that size.

I would expect rpKeepFilesNum to keep a maximum of 10 such files, and rpMaxAgeHours to sweep out all logfiles older than 24 hours.

So far, however, all log files remain in place.

Pioneer logging and monitoring minorfix

Most helpful comment

@CodiePP @vix-io @kevinhammond Any reason this was closed without any comments ??

The issue mentioned in OP was point 3 here does not work as expected for rpKeepFilesNum:
If the number of log files is larger than the configuration setting rpKeepFilesNum, the oldest files in excess are deleted.

The comment from @CodiePP above is about a different parameter rpMaxAgeHours and how it works - quite unrelated to the original issue reported

All 11 comments

log rotation options are described here: https://github.com/input-output-hk/iohk-monitoring-framework/wiki/Log-rotation
the rpMaxAgeHours defines how old a log file may be to be reused. Meaning at startup of the node, if the file is older than 24 hours in this case, then a new log file will be created.

Hi, gufmar this is Viktor at IOHK Tech Support. Thank you for reporting this bug. We have added it to our backlog and we`ll allocate it to one of our future development sprints. We appreciate your participation and support for the Cardano project.

Any updates on this one?
Note: Perhaps this should be moved to https://github.com/input-output-hk/iohk-monitoring-framework repo for better target teams?

@CodiePP @vix-io @kevinhammond Any reason this was closed without any comments ??

The issue mentioned in OP was point 3 here does not work as expected for rpKeepFilesNum:
If the number of log files is larger than the configuration setting rpKeepFilesNum, the oldest files in excess are deleted.

The comment from @CodiePP above is about a different parameter rpMaxAgeHours and how it works - quite unrelated to the original issue reported

We also have the same problem as log rotation is not happening. Hope this issue is still open. TICKER : ADAGL

@mestakepool can you please describe your observation here?

"rotation": {
"rpKeepFilesNum": 10,
"rpLogLimitBytes": 5000000,
"rpMaxAgeHours": 24
}

I have above mentioned configuration but log file rotation didn't happen till today. I had similar observation for MC4 as well. Please let me know if you need more details.

@CodiePP - Looks like the issue occurs when there is a hyphen in the log filename, I believe this line uses hyphen to divide base filename and timestamp.
If so - would be good to use last hyphen in fName for timestamp, since its a suffix added by rotator (we will remove hyphen from log filename meanwhile).

Thanks to @erikd - was a 2 minute thing for him to identify 馃槃

Are there any news about this issue as it still persists in 1.24.2?

@amani1104, is there an option for you to use a log filename without a hyphen?

We have this problem in our short list, but it's not on the absolute top.

@deepfire, yes, I understood now that this is the simplest way to solve the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mark-stopka picture mark-stopka  路  6Comments

deepfire picture deepfire  路  4Comments

bobdobs picture bobdobs  路  8Comments

cardanians picture cardanians  路  6Comments

aftershowrc picture aftershowrc  路  3Comments