I have one particular service, that logs rare, but important information. I've set it up few months ago, and today I've run
journalctl -n 50 --unit=my-service only to find there are no entries.
I'm perfectly happy with this behavior for most units — I either need something that happened right away (or few days ago at most), and I don't care about months-old records.
However, is there a way to tell
journald to have an independent storage and retention policy for a single particular unit's records? I want to persist those particular logs for, say, 5 years — no matter the size it would take. The other units' logs should be unaffected by this, and retain their existing behavior.
I'm sort of lost understanding
journald.conf(5), and can't figure out whenever per-unit configuration is possible at all. If it is — would appreciate a brief concrete example - which file should I edit/create and what should I write. Or, if you know for sure it's certainly not doable — that would be a good answer as well.
NOTE: My particular case involves Arch Linux host, but I guess this shouldn't matter much.