does logging to ram by default and only enabling persistent logging on demand still make sense to reduce flash wear?
My personal opinion as a user: to memory sounds better. I only suggested /var/log because I imagined it was one of the simplest ways to set it up. But I suppose ideally either /var/log should be a memory only tmpfs, or all the logs should be some sort of memory log. (I'm not familiar with logread I have to admit, so can't say anything about that.) I'm pretty sure for investigating most bugs, one wouldn't need more than maybe 1-5KB ish of logs before the current point anyway, and that's what the logs seem most useful for.
ModemManager -> logging seems to be disabled by default?
ModemManager does logging same way as NetworkManager does. They appear in logread. To increase verbosity of ModemManager logs one needs to add --debug to openrc's service file in daemon start command line.
Indeed ModemManager logs like NetworkManager.
It hides a bunch of things though as it never starts in DEBUG mode.
I vote against making it the default because:
It logs sensitive info like phone numbers, text messages, IMEI, cell towers, etc.
It is resource intensive
Upstream makes it easy to lower to debug mode, for a reason.
Moreover, I am not a fan of logging everything into the same file. It makes it difficult to search.
It is one of the biggest issues I have with systemd/journalctl.
Changing the logging stuff, heavily diverts from Alpine IMO.
We could maybe provide some package you can install that adds output_log= and error_log to various services and mounts the log directory as tmpfs.
I poked around the logs a bit, and while sudo mmcli -G DEBUG seems to work, logread for me annotates ModemManager/modemmanager without stating the daemon:
Compare NetworkManager:
Jun 23 12:57:10 myphone daemon.info NetworkManager[2513]: <info> [1655981830.7503] modem-broadband[cdc-wdm0]: IPv6 base configuration:
This makes it almost guaranteed for users to miss and be confused about where the ModemManager logging even goes to, even when they actually tried to find it in logread. So while logread seems sufficient, the annotation appears to be buggy.
On a side note, when I asked in the official postmarketOS matrix chat, nobody seemed to know ModemManager logs to this logread thing or that sudo mmcli -G DEBUG exists. Everyone assumed that it needs to be started manually with special log options to both increase verbosity and redirect it into a file. I don't know in what places of the documentation the logging could be mentioned better to address this, but there seems to be a bit of an information gap with the people who want to look at the logs apparently often not knowing logread has them.