Enabling logging in Gitblit .war ( gitblit is working fine over https)

553 views
Skip to first unread message

ruisse...@gmail.com

unread,
Jul 8, 2016, 10:28:32 AM7/8/16
to gitblit
Hello,
I've deployed Gitblit .war on Tomcat 7, Redhat 7.

Everything is working fine (clone over https etc), but I also want to enable Active Directory integration.

So I configured:
[root@server ~]# cat /var/lib/tomcat/webapps/gitblit/WEB-INF/data/gitblit.properties
# GITBLIT.PROPERTIES
# SINCE 1.7.0
include
= defaults.properties
# Define your overrides or custom settings below
realm
.userService=com.gitblit.LdapUserService
lm
.ldap.server = ldaps://ad.local:636
realm
.ldap.username = svc_ldap
realm
.ldap.password = password
realm
.ldap.accountBase = CN=svc_ldap,OU=Administrative,DC=company,DC=local
realm
.ldap.groupBase = OU=Administrative,DC=company,DC=local
realm
.ldap.accountPattern = (&(objectClass=person)(sAMAccountName=${username}))
realm
.ldap.groupMemberPattern = (&(objectClass=group)(member=${dn}))
realm
.ldap.displayName = displayName
realm
.ldap.email = mail

The problem is that I only have my tomcat log files in /var/log/tomcat and there are no gitblit log files.

I've read something about configuring log4j, but the log files are not created. How do I get this to work?
I tried
[root@server ~]# cat /etc/sysconfig/tomcat | grep log4
JAVA_OPTS
="-Djdk.tls.ephemeralDHKeySize=2048 -Dconfig.location=file -Dlog4j.configuration=file:///var/lib/tomcat/webapps/gitblit/WEB-INF/classes/log4j.properties"

The documentation is not clear about where to place the log4j.properties and how to enable it properly.
I also placed it in /var/lib/tomcat/webapps/gitblit/WEB-INF/data/ and /var/lib/tomcat/webapps/gitblit/WEB-INF/lib but no luck.

I'm using this log4j.properties file:

https://github.com/gitblit/gitblit/blob/master/src/main/java/log4j.properties

James Moger

unread,
Jul 8, 2016, 11:13:26 AM7/8/16
to git...@googlegroups.com
When you run Gitblit in a servlet container (e.g. Tomcat) the log output (by default) goes to the container, in this case catalina.out, I think.

-J

--
You received this message because you are subscribed to the Google Groups "gitblit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitblit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ruisse...@gmail.com

unread,
Jul 10, 2016, 3:37:34 PM7/10/16
to gitblit
Thanks for your comment....
Actually it doesn't. I get all the tomcat logs in catalina.out, but no gitblit. (The only message I got is "deploying gitblit.war......" )
I really need those log files.

The following link describes log4j configuration, but I don't know how to enable it outside the war file itself.


Reply all
Reply to author
Forward
0 new messages