how exactly balena device logs work on OpenBalena

Hi everyone, i have some questions about device logs on openbalena.

if persistent logging is not enabled, whats the storage limit for local logs?
are those logs uploaded to the server, if so, for how much time are they persisted?
if persistent logging is enabled, are the logs limited to 32MB on the device? do they get uploaded to the server?

does the balena-cli grab the logs from the server or directly from the decive using the vpn?
the docs specify that the logs are deleted from the device after every restart, but i can keep seeing logs from past restarts on my device using the cli.
thanks in advance.

From BalenaOS 2.x docs:

In balenaOS, logs are written to an 8 MB journald RAM buffer in order to avoid wear on the flash storage used by most of the supported boards.

This appears to be shared between all containers and system logs. I checked balena logs for the main service on one long-running device and found slightly over 0.5 MB there. The same link covers the persistent size limits too (32 on everything since 2.45).

And yes, I have seen BalenaOS send log stream requests to a server, though I am not sure whether all devices do this constantly, or only ones that have been asked for logs via the CLI at some point since booting. Probably not affected by persistence settings. Logs are definitely deleted without persistence, so any longer history that you see must be from the server.