Index: eclipse-templates/.classpath
===================================================================
--- eclipse-templates/.classpath (revision 1051227)
+++ eclipse-templates/.classpath (working copy)
@@ -25,7 +25,7 @@
-
+
Index: conf/hive-log4j.properties
===================================================================
--- conf/hive-log4j.properties (revision 1051227)
+++ conf/hive-log4j.properties (working copy)
@@ -12,8 +12,13 @@
#
# Daily Rolling File Appender
#
+# Use the PidDailyerRollingFileAppend class instead if you want to use separate log files
+# for different CLI session.
+#
+# log4j.appender.DRFA=org.apache.hadoop.hive.ql.log.PidDailyRollingFileAppender
log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
+
log4j.appender.DRFA.File=${hive.log.dir}/${hive.log.file}
# Rollver at midnight
Index: ql/src/java/org/apache/hadoop/hive/ql/log/PidDailyRollingFileAppender.java
===================================================================
--- ql/src/java/org/apache/hadoop/hive/ql/log/PidDailyRollingFileAppender.java (revision 0)
+++ ql/src/java/org/apache/hadoop/hive/ql/log/PidDailyRollingFileAppender.java (revision 0)
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.log;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+
+import org.apache.log4j.DailyRollingFileAppender;
+
+public class PidDailyRollingFileAppender extends DailyRollingFileAppender {
+
+ @Override
+ public void setFile(String file) {
+ RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
+ super.setFile(file + '.' + rt.getName());
+ }
+}