Changing the default gitolite location
I am using gitolite version 3.6.3 on linux Centos
I need to change the default location of the default gitolite logs
~/.gitolite/logs/gitolite-%y-%m.log
to a custom location like
/home/my_account/Desktop/gitolite-logs/gitolite-%y-%m.log
I tried to achieve this by editing the .gitolite.rc file with
LOG_DEST => '/home/my_account/Desktop/gitolite-logs/gitolite-%y-%m.log',
but I'm out of luck. Did I miss something?
source to share
You can see different meanings for LOG_DEST
in src/lib/Gitolite/Rc.pm
.
The actual file is obtained from $ENV{GL_LOGFILE}
: see src/lib/Gitolite/Common.pm
, which defaults ~/.gitolite/logs/gitolite-%y-%m.log
to as computedgen_lfn
.
So, leave LOG_DEST
for example " normal
" and set the environment variable GL_LOGFILE
to the desired path (it represents " logdir
").
OP Angelo advises in the comments to add to .bashrc
:
export GL_LOGFILE=/home/my_account/Desktop/gitolite-logs/gitolite.log
And if you need to add a timestamp:
export GL_LOGFILE='/home/my_account/Desktop/gitolite-logs/gitolite-'$(date +%Y-%m-%d)'.log'
source to share
GL_LOGFILE is an environment variable that accepts the fully qualified filename; not the directory name (as far as I remember).
It is not interpreted in any way - you put where you want after doing any substitutions you want.
If you need something that interprets% y-% m stuff, create an rc variable called LOG_TEMPLATE. The default is "$ ENV {HOME} /. Gitolite / logs / gitolite-% y-% m.log". You can also add% d, but nothing will be interpreted. (Like hours / minutes, etc.).
(... and now I look at the code where I find some dead code there! Darnit!)
source to share