RFE: support both volatile and persistent storage in journald with different log levels
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 16.7k
- Forks
- 4.7k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 140
Description
Is your feature request related to a problem? Please describe.
We've got a use case where the board has a seriously flimsy, slow, weary and teary eMMC unit. We'd like to reduce usage to a minimum, and the first candidate is reducing log storage to error and above only.
Describe the solution you'd like
Journald already supports reading from multiple file storages, so in principle writing to multiple files doesn't sound too out of the world, although I have not scoped it in the slightest.
But if it were possible to have something that looked like from the user config point of view it would be truly fantastic:
Storage=both
MaxLevelStore=debug
MaxLevelStorePersistent=error
In fact, the slightly misworded current documentation of MaxLevelStore led us to believe this was already possible, which made everybody very happy. And then very sad, once we found out it wasn't the case. Would be great to be happy again :-)
Describe alternatives you've considered
The only alternative I can think of would be to set journald to volatile storage, and then forward to an alternative logger (eg: rsyslog) which writes only a certain level to disk. But that means losing features like journal sealing, and also means having another package to configure, debug and maintain, with all its dependencies. This is an embedded use case, so image footprint matters a lot.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by reading journald's existing Storage and MaxLevelStore configuration and documentation, then trace how volatile and persistent storage are selected. Done means supporting distinct log-level limits for each storage type and correcting the documentation so the behavior is unambiguous.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- observability-sre, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100