Skip to content
Browse files

Move the log4j.properties around so as not to conflict with dependent…

… projects
  • Loading branch information...
1 parent bcf23c5 commit 82d996db7e6f6e865740b66b5f8491e5b0d21dd3 @jwills jwills committed
View
2 java/client/src/main/java/com/cloudera/kitten/client/KittenClient.java
@@ -25,6 +25,7 @@
import org.apache.hadoop.yarn.api.records.ApplicationReport;
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
import org.apache.hadoop.yarn.api.records.YarnApplicationState;
+import org.apache.log4j.PropertyConfigurator;
import com.cloudera.kitten.client.params.lua.LuaYarnClientParameters;
import com.cloudera.kitten.client.service.YarnClientServiceImpl;
@@ -101,6 +102,7 @@ public int handle(YarnClientService service) throws Exception {
}
public static void main(String[] args) throws Exception {
+ PropertyConfigurator.configure("log4j/log4j.properties");
int rc = ToolRunner.run(new Configuration(), new KittenClient(), args);
System.exit(rc);
}
View
0 ...ommon/src/main/resources/log4j.properties → ...lient/src/test/resources/log4j.properties
File renamed without changes.
View
9 java/common/src/main/resources/log4j/log4j.properties
@@ -0,0 +1,9 @@
+# ***** Set root logger level to INFO and its only appender to A.
+log4j.logger.com.cloudera.kitten=info, A
+log4j.logger.org.apache.hadoop=error, A
+
+# ***** A is set to be a ConsoleAppender.
+log4j.appender.A=org.apache.log4j.ConsoleAppender
+# ***** A uses PatternLayout.
+log4j.appender.A.layout=org.apache.log4j.PatternLayout
+log4j.appender.A.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
View
2 java/master/src/main/java/com/cloudera/kitten/appmaster/ApplicationMaster.java
@@ -18,6 +18,7 @@
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
+import org.apache.log4j.PropertyConfigurator;
import com.cloudera.kitten.appmaster.params.lua.LuaApplicationMasterParameters;
import com.cloudera.kitten.appmaster.service.ApplicationMasterServiceImpl;
@@ -41,6 +42,7 @@ public int run(String[] args) throws Exception {
}
public static void main(String[] args) throws Exception {
+ PropertyConfigurator.configure("log4j/log4j.properties");
try {
int rc = ToolRunner.run(new Configuration(), new ApplicationMaster(), args);
System.exit(rc);

0 comments on commit 82d996d

Please sign in to comment.
Something went wrong with that request. Please try again.