Permalink
Browse files

Fix to log4j set up in bin/run-class.sh that should correctly configu…

…re log4j.
  • Loading branch information...
1 parent d0023e9 commit 667ed5038448090604e1d29078809c67a656cb2b @jayjwylie jayjwylie committed Mar 22, 2013
Showing with 6 additions and 2 deletions.
  1. +5 −2 bin/run-class.sh
  2. +1 −0 src/java/log4j.properties
View
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# Copyright 2008-2009 LinkedIn, Inc
+# Copyright 2008-2013 LinkedIn, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -43,5 +43,8 @@ if [ -z "$VOLD_OPTS" ]; then
VOLD_OPTS="-Xmx2G -server -Dcom.sun.management.jmxremote "
fi
+# add '-Dlog4j.debug ' to debug log4j issues.
+LOG4JPROPERTIES="-Dlog4j.configuration=file:///${base_dir}/src/java/log4j.properties"
+
export CLASSPATH
-java -Dlog4j.configuration=$base_dir/src/java/log4j.properties $VOLD_OPTS -cp $CLASSPATH $@
+java $LOG4JPROPERTIES $VOLD_OPTS -cp $CLASSPATH $@
@@ -18,4 +18,5 @@ log4j.logger.voldemort.server.niosocket=INFO
log4j.logger.voldemort.utils=INFO
log4j.logger.voldemort.client.rebalance=INFO
log4j.logger.voldemort.server=INFO
+log4j.logger.voldemort.routing=INFO
log4j.logger.krati=WARN

2 comments on commit 667ed50

Collaborator

zhongjiewu replied Mar 25, 2013

Hi Jay, this might not be working.

  1. voldemort-server.sh is not using run-class.sh. This fix will not fix the log4j appender problem when you run voldemort-server.sh from somewhere other than voldemort base folder
  2. voldemort-client.sh is not working properly because base_dir=$(dirname $0) will get relative path. the "file:///${base_dir}/" will not get us to the right folder.
Collaborator

zhongjiewu replied Mar 25, 2013

I recommend revert this change and add "run-class.sh" to voldemort-server.sh

Please sign in to comment.