From d00e9e7b99bd2281e657a57539e23a6848011e71 Mon Sep 17 00:00:00 2001 From: Gustaf Lundh Date: Fri, 24 Apr 2015 16:46:52 +0200 Subject: [PATCH] Package jsonevent-layout with war Since java does not allow aditional -classpaths when loading a -jar (or war in Gerrits case), it is more or less impossible to add a new external log4j appender when using embedded jetty. This change packages the common jsonevent-layout appender and its dependencies with gerrit.war, allowing logging in json-format (usable for instance when sending logs to logstash). This change also updates commons-lang from 2.5 to 2.6 which is preferred by jsonevent-layout. Change-Id: I1a6e35c9e0da571bf88718ce5e56c5d9e8649203 --- gerrit-server/BUCK | 1 + lib/commons/BUCK | 4 ++-- lib/log/BUCK | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gerrit-server/BUCK b/gerrit-server/BUCK index ec91d4962f..71e88820c6 100644 --- a/gerrit-server/BUCK +++ b/gerrit-server/BUCK @@ -59,6 +59,7 @@ java_library( '//lib/jgit:jgit-archive', '//lib/joda:joda-time', '//lib/log:api', + '//lib/log:jsonevent-layout', '//lib/log:log4j', '//lib/lucene:analyzers-common', '//lib/lucene:core', diff --git a/lib/commons/BUCK b/lib/commons/BUCK index fe249fa356..4c77d9b033 100644 --- a/lib/commons/BUCK +++ b/lib/commons/BUCK @@ -41,8 +41,8 @@ maven_jar( maven_jar( name = 'lang', - id = 'commons-lang:commons-lang:2.5', - sha1 = 'b0236b252e86419eef20c31a44579d2aee2f0a69', + id = 'commons-lang:commons-lang:2.6', + sha1 = '0ce1edb914c94ebc388f086c6827e8bdeec71ac2', license = 'Apache2.0', exclude = ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt'], ) diff --git a/lib/log/BUCK b/lib/log/BUCK index cadc7e7d1c..b332f20e62 100644 --- a/lib/log/BUCK +++ b/lib/log/BUCK @@ -31,3 +31,18 @@ maven_jar( license = 'Apache2.0', exclude = ['META-INF/LICENSE', 'META-INF/NOTICE'], ) + +maven_jar( + name = 'jsonevent-layout', + id = 'net.logstash.log4j:jsonevent-layout:1.7', + sha1 = '507713504f0ddb75ba512f62763519c43cf46fde', + license = 'Apache2.0', + deps = [':json-smart', '//lib/commons:lang'] +) + +maven_jar( + name = 'json-smart', + id = 'net.minidev:json-smart:1.1.1', + sha1 = '24a2f903d25e004de30ac602c5b47f2d4e420a59', + license = 'Apache2.0', +)