Configuring logging with log4j with Gitblit Go running as a Windows service

729 views
Skip to first unread message

Guillaume Belrose

unread,
Feb 22, 2012, 5:53:35 AM2/22/12
to gitblit
Hi all,

I am using Gitblit internally within my company to host Git
repositories. I really like this tool as it is very easy to configure
and run, and being Java-based it works very well on Windows. I am
using Gitblit Go as a Windows service and I've eventually managed to
tweak the service configuration to customize the log4j logging. In
case you need to do something similar, here are the steps that I've
followed:

Make sure the service is uninstalled, by calling uninstallService.cmd

From the Gitblit Go folder, edit the file installService.cmd

Add a --JvmOptions line with a parameter pointing to your
log4j.properties file. See the example below.

"%CD%\%ARCH%\gitblit.exe" //IS//gitblit ^
--DisplayName="gitblit" ^
--Description="a pure Java Git solution" ^
--Startup=auto ^
--LogPath="%CD%\logs" ^
--LogLevel=INFO ^
--LogPrefix=procrun ^
--StdOutput=auto ^
--StdError=auto ^
--StartPath="%CD%" ^
--StartClass=com.gitblit.Launcher ^
--StartMethod=main ^
--StartParams="--storePassword;gitblit" ^
--StartMode=jvm ^
--StopPath="%CD%" ^
--StopClass=com.gitblit.Launcher ^
--StopMethod=main ^
--StopParams="--stop" ^
--StopMode=jvm ^
--Classpath="%CD%\gitblit.jar" ^
--Jvm=auto ^
--JvmOptions=-Dlog4j.configuration=file:///C:/gitblit-0.8.2/
log4j.properties ^
--JvmMx=1024

Run installService.cmd to reinstall the service.

I am hoping this is useful.

Cheers,

Guillaume.

Reply all
Reply to author
Forward
0 new messages