Skip to content

Commit

Permalink
Fix to log4j set up in bin/run-class.sh that should correctly configu…
Browse files Browse the repository at this point in the history
…re log4j.
  • Loading branch information
jayjwylie committed Mar 22, 2013
1 parent d0023e9 commit 667ed50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/run-class.sh
@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash


# #
# Copyright 2008-2009 LinkedIn, Inc # Copyright 2008-2013 LinkedIn, Inc
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,5 +43,8 @@ if [ -z "$VOLD_OPTS" ]; then
VOLD_OPTS="-Xmx2G -server -Dcom.sun.management.jmxremote " VOLD_OPTS="-Xmx2G -server -Dcom.sun.management.jmxremote "
fi fi


# add '-Dlog4j.debug ' to debug log4j issues.
LOG4JPROPERTIES="-Dlog4j.configuration=file:///${base_dir}/src/java/log4j.properties"

export CLASSPATH export CLASSPATH
java -Dlog4j.configuration=$base_dir/src/java/log4j.properties $VOLD_OPTS -cp $CLASSPATH $@ java $LOG4JPROPERTIES $VOLD_OPTS -cp $CLASSPATH $@
1 change: 1 addition & 0 deletions src/java/log4j.properties
Expand Up @@ -18,4 +18,5 @@ log4j.logger.voldemort.server.niosocket=INFO
log4j.logger.voldemort.utils=INFO log4j.logger.voldemort.utils=INFO
log4j.logger.voldemort.client.rebalance=INFO log4j.logger.voldemort.client.rebalance=INFO
log4j.logger.voldemort.server=INFO log4j.logger.voldemort.server=INFO
log4j.logger.voldemort.routing=INFO
log4j.logger.krati=WARN log4j.logger.krati=WARN

2 comments on commit 667ed50

@zhongjiewu
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zhongjiewu
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.