First and foremost, great job on building such a nice git web ui. I'm
migrating our repos from gitorious to gitblit now!
I'm trying to run gitblit as a service under Ubuntu server but I can't
seem to be able to configure log4j to log to a file instead of the
console. I tried passing -Dlog4j.configuration=custom_log4j.properties
but that didn't work. Seems like log4j configuration is read from temp/
webapp/log4j.properties and gets overwritten every time the server
start.
In addition, the current gitlab init.d script runs as root, I'm not
that good with bash, but I think it would be better if there was a way
to specify it to run with a less privileged user.
Gitblit GO does not allow modifying the log4j configuration.
Having said that GO does create log files. They should be located in a "logs" folder wherever you unpacked the GO zip file.
> In addition, the current gitlab init.d script runs as root, I'm not > that good with bash, but I think it would be better if there was a way > to specify it to run with a less privileged user.
I can not speak for Gitlab, that is not my project.
Hmmm. It seems that GO is not properly creating log files. I'm going to revise the service scripts for the next release as I can see there are issues with them.
Below is a revised script that I am using on Ubuntu Server 11.04. The console output is redirected to a log file. You don't get rotation, etc, but it is a start. Alternatively, you could install Tomcat and use the WAR build.
> Gitblit GO does not allow modifying the log4j configuration.
> Having said that GO does create log files. They should be located in > a "logs" folder wherever you unpacked the GO zip file.
>> In addition, the current gitlab init.d script runs as root, I'm not >> that good with bash, but I think it would be better if there was a way >> to specify it to run with a less privileged user.
> I can not speak for Gitlab, that is not my project.
> Hmmm. It seems that GO is not properly creating log files. I'm going > to revise the service scripts for the next release as I can see there > are issues with them.
> Below is a revised script that I am using on Ubuntu Server 11.04. The > console output is redirected to a log file. You don't get rotation, > etc, but it is a start. Alternatively, you could install Tomcat and > use the WAR build.
Yes, it probably does run as root. I personally don't have a problem with that. Linux service scripts are a shortcoming in Gitblit. Unfortunately, there is no one script that will work across all flavors and as you point out you may want to run as a less privileged user which may require doing a useradd and chgrp during install-service. If you come up with a more manageable solution please open a pull request on GitHub and I'll merge it.
I'm going to work on integrating GitBlit with Tomcat with Apache front-end using AJP and running it using Java Service Wrapper as a standard unix daemon. This is more of a production setup. I will email you the instructions.
Thanks again for creating GitBlit. I'm really starting to like it.
> Yes, it probably does run as root. I personally don't have a problem > with that. Linux service scripts are a shortcoming in Gitblit. > Unfortunately, there is no one script that will work across all > flavors and as you point out you may want to run as a less privileged > user which may require doing a useradd and chgrp during > install-service. If you come up with a more manageable solution > please open a pull request on GitHub and I'll merge it.
I'm actually currently running GitBlit behind Apache using mod_proxy_http and I had the slash encoding issue so I disabled web.mountParameters since my apache doesn't support AllowEncodedSlashes NoDecode. I'm hoping I can get the pretty URLs to work using Tomcat/AJP.
I still prefer using GitBlit GO if I can get the custom logging and AJP connector.
I'd like to see an ajp-connector in the standalone (GO) version.
Any plans on adding ajp ?
Couldn't spot it on the Roadmap.
Note: For sure it would be possible to use the war-version and tomcat
to get ajp working, but as I use tomcat for ci-deployments its a
rather bad
idea to deploy gitblit to it. A separate tomcat-instance seems like an
overkill.
I guess there are many people that would like to use ajp with there
own reasons.
On 3 Feb., 18:56, Drew Kutcharian <d...@venarc.com> wrote:
I looked into moving log4j.properties and I remember now why it is in inside the jar. When this file is on the classpath it is automatically loaded by log4j both in deployment and in an IDE. Otherwise you have to specify its location manually. I can still do this but for the time being I won't because it complicates things when there are alternatives.
The -D parameter you tried specifying does work, but you have to specify it as a URL:
I'll improve the documentation on this for the next release.
The following is Gitblit's log4j configuration. I forgot that I had disabled the file appenders - they are defined just not activated.
#-------------------------------------------------------------------------- ---- # # The following properties set the logging levels and log appender. The # log4j.rootCategory variable defines the default log level and one or more # appenders. For the console, use 'S'. For the daily rolling file, use 'R'. # For an HTML formatted log, use 'H'. # # To override the default (rootCategory) log level, define a property of the # form (see below for available values): # # log4j.logger. = # # Available logger names: # TODO # # Possible Log Levels: # FATAL, ERROR, WARN, INFO, DEBUG # #-------------------------------------------------------------------------- ---- log4j.rootCategory=INFO, S
Thanks James. I ended up using Tomcat and was able to configure the logging using log4j. But I think it's a great idea to update the docs since most users will be using the standalone version.
> I looked into moving log4j.properties and I remember now why it is in inside the jar. When this file is on the classpath it is automatically loaded by log4j both in deployment and in an IDE. Otherwise you have to specify its location manually. I can still do this but for the time being I won't because it complicates things when there are alternatives.
> The -D parameter you tried specifying does work, but you have to specify it as a URL:
> I'll improve the documentation on this for the next release.
> The following is Gitblit's log4j configuration. I forgot that I had disabled the file appenders - they are defined just not activated.
> #-------------------------------------------------------------------------- ---- > # > # The following properties set the logging levels and log appender. The > # log4j.rootCategory variable defines the default log level and one or more > # appenders. For the console, use 'S'. For the daily rolling file, use 'R'. > # For an HTML formatted log, use 'H'. > # > # To override the default (rootCategory) log level, define a property of the > # form (see below for available values): > # > # log4j.logger. = > # > # Available logger names: > # TODO > # > # Possible Log Levels: > # FATAL, ERROR, WARN, INFO, DEBUG > # > #-------------------------------------------------------------------------- ---- > log4j.rootCategory=INFO, S