Ludovic Courtès <l...@gnu.org> writes:

> Hi Tomas,
>
> Tomas Volf <~@wolfsden.cz> writes:
>
>> --8<---------------cut here---------------start------------->8---
>>      Warning: The Rottlog service presented here is deprecated in favor
>>      of ‘log-rotation-service-type’ (see above).  The
>>      ‘rottlog-service-type’ variable and related tools will be removed
>>      after 2025-06-15.
>> --8<---------------cut here---------------end--------------->8---
>>
>> Since the date is pretty close now, I want to ask whether the removal
>> can be postponed until there is a feature parity between those two
>> services?  The log-rotation-service-type currently seems quite limited
>> in comparison to the originally used rottlog.
>
> Yes, we can delay it if needed.
>
> However, could you clarify what features exactly you’d like to see?  (We
> had a brief discussion on Mastodon a while back but I’m not sure what
> the takeaway was.)

Sure, I will summarize my notes from Mastodon here. :) I will try to
also state the use cases (since I am not limited to 500 characters
here).

>
> Namely, ‘log-rotation’ is more opinionated and simpler than rottlog in
> several ways: there’s only a global configuration (rather than
> per-file), only one file (re)naming scheme, and probably a couple
> more.

1. Per-log file settings.  Some files I want to never rotate (the data
   has sentimental value).  Some files I want to rotate, but keep *all*
   previous versions (if I would be using Guix at work, this is required
   for auditing reasons).

2. Option to limit number of rotated versions being kept.  Currently,
   any single "log stream" can occupy unlimited disk space even with
   frequent rotations.  To prevent that, I would like to express expiry
   in terms of "keep current and 4 rotated versions", but that is not
   possible as far as I can tell.

3. Run-time discovery of log files to rotate.  I have no idea how to use
   shepherd for rotating samba's log files for example, their names are
   (in my configuration) dynamic based on the host name of the machine
   that connects to the samba share.  Their only shared trait is that
   they are under /var/log/samba.d and end in .log.

>
> I think we could add more flexibility to ‘log-rotation’ if there’s
> demand, but I don’t think the level of flexibility that rottlog claims
> to provide is necessarily a good idea.

What is your opinion on turning the log rotation into a plug-able
mechanism?  I did not look too closely yet how this part of code works,
but for example being able to set global parameter to a callback to do
the log rotation could allow lot of flexibility while keeping it out of
Shepherd itself.

I fully agree with Shepherd shipping an opinionated default rotate rules
(even if I might not agree with all the opinions), but would be nice if
I could just fully replace the rules in my Guix system definition.  If
the "replace the rules" would just be "plug some Scheme code here", it
would interesting.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

Attachment: signature.asc
Description: PGP signature

Reply via email to