#990431 gitolite3: put logs in /var/log/gitolite3 and add logrotation

Package:
gitolite3
Source:
gitolite3
Submitter:
Christoph Anton Mitterer
Date:
2021-07-02 22:30:03 UTC
Severity:
wishlist
#990431#5
Date:
2021-06-28 22:08:10 UTC
From:
To:
Hey.

It would be nice if the logs were moved from currently:
/var/lib/gitolite3/.gitolite/logs

to some location on /var/log.


And also some logrotate config would be great :-)


Cheers,
Chris.

#990431#10
Date:
2021-06-29 14:12:18 UTC
From:
To:
Christoph Anton Mitterer <calestyo@scientia.net> writes:

See

https://gitolite.com/gitolite/dev-notes.html#appendix-3-sending-log-lines-to-syslog

for how to configure your gitolite install to use syslog.

I guess one could in principle ship different defaults in
/etc/gitolite3/gitolite.rc, but that is a minor maintainence burden
merging from upstream.

Hmm. I think that would depend too much on a particular local logging
configuration. It doesn't make sense to me for gitolite to depend on
e.g. rsyslog.

#990431#15
Date:
2021-07-02 22:28:00 UTC
From:
To:
Yeah, that's clear,... but then it does go to syslog... plus the
default out-of-the-box installation would still put non-rotated files
into a path that is not really typical for logs :-)
- ship /var/log/gitolite3 with appropriate permissions/owners as part
  of the package
- overwrite /var/lib/gitolite3/.gitolite/logs to be a symlink to the
  former
- add a logrotation snippet as conffile to /etc/logrotate.d/gitolite3

That way you wouldn't need to fiddle around with the sources and all
would still be like upstream... just that it goes of to another
location.
And all users of the gitolite would benefit from it.


I guess the only thing to consider is, that any log-files that already
exist in the (then) old location on upgrade would need to be moved to
/var/log/gitolite3.

Why that? logrotate is the standard logrotation tool used in Debian by
many services.
And it should be pretty independent of rsyslog, it just takes rotates
the logfiles in whichever path given.

And if someone configures his gitolite to use syslog instead of files
in, the logrotate snippet would simply do nothing (once all existing
files have been rotated away).
Same if someone configures it to use systemd journald.

Right now at least, we have the situation that nothing seems to rotate
these files and they could in principle fill up the filesystem
eventually.


Cheers,
Chris