Page MenuHomeVyOS Platform

Ability to disable all logs
Open, LowPublicFEATURE REQUEST

Description

In some cases, you don't need any logs, journalctl/atop/frr/.
For example, you have a drive with a limited number of rewrites so on.
Consider disabling all logs or decrease them to a minimum

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

Suggestion:

set system options logtoram

Not set = disabled, set = enabled.

Since some logs would be needed for troubleshooting, but as a ringbuffer, enabling this feature with set system options logtoram (or whatever the feature might be called) would be handy for systems where a persistent logging (survive between boots) isnt needed (like in combo with remote syslog) and/or for systems installed on write sensitive datamedia such as SD-cards, USB-drives etc.

Mounting a ram disk on top should be pretty easy.
The question is, how much ram should be allocated for this, and how to make sure it doesn't run out of space.
I am no expert in logrotate, but it sounds like it should be able to do it.

Maybe making the size of the ramdisk configurable via CLI would be wise? I feel that there's enough variation in hardware configurations out there that hard-coding a value would cause problems.

Could for example be that set system options logtoram enables the feature while set system options logtoram size 32M sets the desired size where the default is 32M or whatever would be needed as a sane minimum.

Im thinking something like 10.000 rows of logs per logtype should be "more than enough" as a default (which then can be expanded so if you sit with a 32GB RAM box you can set aside 8GB or whatever you like).

What to do with atop and logrorate?

Logrotate just renames the logs so that doesnt bring many writes.

atop and other writedependent applications could either be disabled when "logtoram" is enabled (put a warning both when enabling "logtoram" during commit but also during boot) or a 2nd option to logtoram could be used per application to bypass the "logtoram" - that is if atop is compatible to logging to ram when "logtoram" is enabled then the bypass command would only be needed if the admin want atop to write to the disk anyway.

For example if one for whatever reason wants to have logtoram enabled (as in only have a ringbuffer in RAM in order to save the SD-card) yet also want to have "atop" logging to disk.

Something like this:

Enable "logtoram":

set system options logtoram

Let atop bypass and write to disk:

set system options logtoram writetodisk atop

Without the above "writetodisk" then atop would write to RAM when "logtoram" is enabled.