On 02/06/14 07:32 PM,
chie...@salk.edu wrote:
> I've looked and I don't see a simple way to redirect gitolite logging from ~/.gitolite/logs to syslog.
It is a feature I'd like to see as well -- not as a replacement for
~/.gitolite/logs, but as an addition.
> Does anyone know how to do this simply?
If you are using rsyslog, you can do the following. Add this to your
rsyslog.conf (fixing paths as necessary):
# Send gitolite logs to rsyslog via
local5.info
$ModLoad imfile
$InputFileName /var/lib/gitolite/.gitolite/logs/gitolite.log
$InputFileTag gitolite:
$InputFileStateFile stat-gitolite-log
$InputFileSeverity info
$InputFileFacility local5
$InputRunFileMonitor
Then symlink gitolite.log to the current gitolite-YYYY-MM-DD.log, and
then create the following cronjob to make sure the symlink is updated
each month (assuming your gitolite runs as user "gitolite"):
0 0 1 * * gitolite ln -sf
/var/lib/gitolite/.gitolite/logs/gitolite-$(date +'\%Y-\%m').log
/var/lib/gitolite/.gitolite/logs/gitolite.log
Best,
Konstantin