tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject git commit: TAJO-768: Improve the log4j configuration. (hyoungjunkim via jinho)
Date Thu, 17 Apr 2014 04:46:46 GMT
Repository: tajo
Updated Branches:
  refs/heads/branch-0.8.0 4444dcfdf -> 99c5c33b9


TAJO-768: Improve the log4j configuration. (hyoungjunkim via jinho)


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/99c5c33b
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/99c5c33b
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/99c5c33b

Branch: refs/heads/branch-0.8.0
Commit: 99c5c33b91bff9e55c9259686e66e0f8342f77f3
Parents: 4444dcf
Author: jinossy <jinossy@gmail.com>
Authored: Thu Apr 17 13:46:01 2014 +0900
Committer: jinossy <jinossy@gmail.com>
Committed: Thu Apr 17 13:46:01 2014 +0900

----------------------------------------------------------------------
 CHANGES.txt                              |  2 +
 tajo-dist/src/main/bin/tajo              | 10 +++-
 tajo-dist/src/main/bin/tajo-daemon.sh    |  2 +-
 tajo-dist/src/main/conf/log4j.properties | 67 +++++++++++++++++++++++++--
 4 files changed, 73 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/99c5c33b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index abc0da8..0470e07 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -147,6 +147,8 @@ Release 0.8.0 - unreleased
 
   IMPROVEMENTS
 
+    TAJO-768: Improve the log4j configuration. (hyoungjunkim via jinho)
+
     TAJO-755: ALTER TABLESPACE LOCATION support. (hyunsilk)
     
     TAJO-732: Support executing LINUX shell command and HDFS command.

http://git-wip-us.apache.org/repos/asf/tajo/blob/99c5c33b/tajo-dist/src/main/bin/tajo
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/bin/tajo b/tajo-dist/src/main/bin/tajo
index 0a7ec13..a05c65c 100755
--- a/tajo-dist/src/main/bin/tajo
+++ b/tajo-dist/src/main/bin/tajo
@@ -46,7 +46,6 @@
 #
 #   TAJO_CONF_DIR  Alternate conf dir. Default is ${TAJO_HOME}/conf.
 #
-#   TAJO_ROOT_LOGGER The root appender. Default is INFO,consoles
 #
 
 bin=`dirname "$0"`
@@ -343,12 +342,15 @@ elif [ "$COMMAND" = "catalog" ] ; then
   TAJO_OPTS="$TAJO_OPTS $TAJO_CATALOG_OPTS"
 elif [ "$COMMAND" = "cli" ] ; then
   CLASS='org.apache.tajo.cli.TajoCli'
+  TAJO_ROOT_LOGGER_APPENDER="${TAJO_ROOT_LOGGER_APPENDER:-NullAppender}"
   TAJO_OPTS="$TAJO_OPTS $TAJO_CLI_OPTS"
 elif [ "$COMMAND" = "admin" ] ; then
   CLASS='org.apache.tajo.client.TajoAdmin'
+  TAJO_ROOT_LOGGER_APPENDER="${TAJO_ROOT_LOGGER_APPENDER:-NullAppender}"
   TAJO_OPTS="$TAJO_OPTS $TAJO_CLI_OPTS"
 elif [ "$COMMAND" = "dump" ] ; then
   CLASS='org.apache.tajo.client.TajoDump'
+  TAJO_ROOT_LOGGER_APPENDER="${TAJO_ROOT_LOGGER_APPENDER:-NullAppender}"
   TAJO_OPTS="$TAJO_OPTS $TAJO_DUMP_OPTS"
 else
   CLASS=$COMMAND
@@ -394,7 +396,11 @@ TAJO_OPTS="$TAJO_OPTS -Dtajo.log.dir=$TAJO_LOG_DIR"
 TAJO_OPTS="$TAJO_OPTS -Dtajo.log.file=$TAJO_LOGFILE"
 TAJO_OPTS="$TAJO_OPTS -Dtajo.home.dir=$TAJO_HOME"
 TAJO_OPTS="$TAJO_OPTS -Dtajo.id.str=$TAJO_IDENT_STRING"
-TAJO_OPTS="$TAJO_OPTS -Dtajo.root.logger=${TAJO_ROOT_LOGGER:-INFO,console}"
+TAJO_OPTS="$TAJO_OPTS -Dtajo.root.logger.appender=${TAJO_ROOT_LOGGER_APPENDER:-console}"
+if [ "x$TAJO_ROOT_LOGGER_LEVEL" != "x" ]; then
+  TAJO_OPTS="$TAJO_OPTS -Dtajo.root.logger.level=${TAJO_ROOT_LOGGER_LEVEL}"
+fi
+
 if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
   TAJO_OPTS="$TAJO_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
 fi  

http://git-wip-us.apache.org/repos/asf/tajo/blob/99c5c33b/tajo-dist/src/main/bin/tajo-daemon.sh
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/bin/tajo-daemon.sh b/tajo-dist/src/main/bin/tajo-daemon.sh
index 1d4a22b..ff3a764 100755
--- a/tajo-dist/src/main/bin/tajo-daemon.sh
+++ b/tajo-dist/src/main/bin/tajo-daemon.sh
@@ -93,7 +93,7 @@ fi
 
 # some variables
 export TAJO_LOGFILE=tajo-$TAJO_IDENT_STRING-$command-$HOSTNAME.log
-export TAJO_ROOT_LOGGER="INFO,DRFA"
+export TAJO_ROOT_LOGGER_APPENDER="${TAJO_ROOT_LOGGER_APPENDER:-DRFA}"
 log=$TAJO_LOG_DIR/tajo-$TAJO_IDENT_STRING-$command-$HOSTNAME.out
 pid=$TAJO_PID_DIR/tajo-$TAJO_IDENT_STRING-$command.pid
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/99c5c33b/tajo-dist/src/main/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/tajo-dist/src/main/conf/log4j.properties b/tajo-dist/src/main/conf/log4j.properties
index f46fffb..95ac458 100644
--- a/tajo-dist/src/main/conf/log4j.properties
+++ b/tajo-dist/src/main/conf/log4j.properties
@@ -12,8 +12,65 @@
 
 # log4j configuration used during build and unit tests
 
-log4j.rootLogger=info,stdout
-log4j.threshhold=INFO
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+tajo.root.logger.appender=console
+tajo.root.logger.level=INFO
+tajo.log.dir=.
+tajo.log.file=tajo.log
+
+# Define the root logger to the system property "tajo.root.logger.appender".
+log4j.rootLogger=${tajo.root.logger.level},${tajo.root.logger.appender}
+
+# Logging Threshold
+log4j.threshold=ALL
+
+# Null Appender
+log4j.appender.NullAppender=org.apache.log4j.varia.NullAppender
+
+#
+# Rolling File Appender - cap space usage at 5gb.
+#
+tajo.log.maxfilesize=256MB
+tajo.log.maxbackupindex=20
+log4j.appender.RFA=org.apache.log4j.RollingFileAppender
+log4j.appender.RFA.File=${tajo.log.dir}/${tajo.log.file}
+
+log4j.appender.RFA.MaxFileSize=${tajo.log.maxfilesize}
+log4j.appender.RFA.MaxBackupIndex=${tajo.log.maxbackupindex}
+
+log4j.appender.RFA.layout=org.apache.log4j.PatternLayout
+
+# Pattern format: Date LogLevel LoggerName LogMessage
+log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
+# Debugging Pattern format
+#log4j.appender.RFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+
+
+#
+# Daily Rolling File Appender
+#
+
+log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.DRFA.File=${tajo.log.dir}/${tajo.log.file}
+
+# Rollver at midnight
+log4j.appender.DRFA.DatePattern=.yyyy-MM-dd
+
+# 30-day backup
+#log4j.appender.DRFA.MaxBackupIndex=30
+log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout
+
+# Pattern format: Date LogLevel LoggerName LogMessage
+log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p %c: %m%n
+# Debugging Pattern format
+#log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n
+
+
+#
+# console
+# Add "console" to rootlogger above if you want to use this
+#
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
\ No newline at end of file


Mime
View raw message