gitlogginggitolite

Change gitolite logs default location


I'm using gitolite version 3.6.3 in linux Centos

I need to change the default location of gitolite logs

~/.gitolite/logs/gitolite-%y-%m.log

to a custom location like

/home/my_account/Desktop/gitolite-logs/gitolite-%y-%m.log

I've tried to achieve this by editing .gitolite.rc file with

LOG_DEST                      => '/home/my_account/Desktop/gitolite-logs/gitolite-%y-%m.log',

but I had no luck. Am I missing something?


Solution

  • You can see various values forn LOG_DEST in src/lib/Gitolite/Rc.pm.

    The actual file is derived from $ENV{GL_LOGFILE}: see src/lib/Gitolite/Common.pm, which defaults to ~/.gitolite/logs/gitolite-%y-%m.log, as computed by gen_lfn.

    So leave LOG_DEST to, for instance, 'normal', and set the environment variable GL_LOGFILE to the path you want (it represents a "logdir").

    The OP Angelo reports in the comments having to add to the .bashrc:

    export GL_LOGFILE=/home/my_account/Desktop/gitolite-logs/gitolite.log
    

    And if you need to add some timestamp:

    export GL_LOGFILE='/home/my_account/Desktop/gitolite-logs/gitolite-'$(date +%Y-%m-%d)'.log'