flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [1/6] flink git commit: [FLINK-4820] [core] Make Flink code independent of log4j 1.x
Date Tue, 31 Jan 2017 13:03:25 GMT
Repository: flink
Updated Branches:
  refs/heads/master 294c082e8 -> f3930510c


[FLINK-4820] [core] Make Flink code independent of log4j 1.x


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/478f5d18
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/478f5d18
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/478f5d18

Branch: refs/heads/master
Commit: 478f5d1893e292ad68c2702cdae95771678dbdc2
Parents: 294c082
Author: Stephan Ewen <sewen@apache.org>
Authored: Wed Nov 16 22:13:17 2016 +0100
Committer: Stephan Ewen <sewen@apache.org>
Committed: Tue Jan 31 14:02:43 2017 +0100

----------------------------------------------------------------------
 .../flink/util/MavenForkNumberPrefixLayout.java | 72 --------------------
 .../src/test/resources/log4j-test.properties    |  2 +-
 .../src/test/resources/log4j-test.properties    |  2 +-
 .../src/test/resources/log4j-test.properties    |  2 +-
 .../src/test/resources/log4j-test.properties    |  2 +-
 tools/log4j-travis.properties                   |  2 +-
 6 files changed, 5 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/flink-core/src/main/java/org/apache/flink/util/MavenForkNumberPrefixLayout.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/util/MavenForkNumberPrefixLayout.java
b/flink-core/src/main/java/org/apache/flink/util/MavenForkNumberPrefixLayout.java
deleted file mode 100644
index c6f9012..0000000
--- a/flink-core/src/main/java/org/apache/flink/util/MavenForkNumberPrefixLayout.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.flink.util;
-
-import org.apache.flink.annotation.Internal;
-import org.apache.log4j.PatternLayout;
-import org.apache.log4j.spi.LoggingEvent;
-
-/**
- * The logging layout used to prefix each log event with the Maven fork number.
- * <p>
- * Use this layout when running tests via Maven in parallel and logging to the Console. When
logging
- * to a file, you can use a separate file for each fork.
- */
-@Internal
-public class MavenForkNumberPrefixLayout extends PatternLayout {
-
-	/** Property name used to set fork number of the forked JVM. */
-	private static final String PROPERTY = "mvn.forkNumber";
-
-	private final int prefixLength;
-
-	private final StringBuilder stringBuilder;
-
-	public MavenForkNumberPrefixLayout() {
-		super();
-
-		String prefix = System.getProperty(PROPERTY);
-
-		if (prefix != null) {
-			prefix += " > ";
-
-			prefixLength = prefix.length();
-
-			stringBuilder = new StringBuilder(512);
-			stringBuilder.append(prefix);
-		}
-		else {
-			prefixLength = 0;
-			stringBuilder = null;
-		}
-	}
-
-	@Override
-	public String format(LoggingEvent event) {
-		if (prefixLength == 0) {
-			return super.format(event);
-		}
-
-		stringBuilder.setLength(prefixLength);
-
-		stringBuilder.append(super.format(event));
-
-		return stringBuilder.toString();
-	}
-}

http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/flink-core/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/flink-core/src/test/resources/log4j-test.properties b/flink-core/src/test/resources/log4j-test.properties
index 4c74d85..2be3589 100644
--- a/flink-core/src/test/resources/log4j-test.properties
+++ b/flink-core/src/test/resources/log4j-test.properties
@@ -20,7 +20,7 @@
 # set manually to INFO for debugging purposes
 log4j.rootLogger=OFF, testlogger
 
-# A1 is set to be a ConsoleAppender.
+# testlogger is set to be a ConsoleAppender.
 log4j.appender.testlogger=org.apache.log4j.ConsoleAppender
 log4j.appender.testlogger.target = System.err
 log4j.appender.testlogger.layout=org.apache.log4j.PatternLayout

http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/flink-libraries/flink-ml/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/flink-libraries/flink-ml/src/test/resources/log4j-test.properties b/flink-libraries/flink-ml/src/test/resources/log4j-test.properties
index 023b23a..e2ec1a5 100644
--- a/flink-libraries/flink-ml/src/test/resources/log4j-test.properties
+++ b/flink-libraries/flink-ml/src/test/resources/log4j-test.properties
@@ -22,7 +22,7 @@ log4j.rootLogger=OFF, console
 # Console (use 'console')
 # -----------------------------------------------------------------------------
 log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.flink.util.MavenForkNumberPrefixLayout
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
 
 # -----------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/flink-runtime-web/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/test/resources/log4j-test.properties b/flink-runtime-web/src/test/resources/log4j-test.properties
index 7575897..18b51cc 100644
--- a/flink-runtime-web/src/test/resources/log4j-test.properties
+++ b/flink-runtime-web/src/test/resources/log4j-test.properties
@@ -22,7 +22,7 @@ log4j.rootLogger=OFF, console
 # Console (use 'console')
 # -----------------------------------------------------------------------------
 log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.flink.util.MavenForkNumberPrefixLayout
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
 
 # -----------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/flink-runtime/src/test/resources/log4j-test.properties
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/resources/log4j-test.properties b/flink-runtime/src/test/resources/log4j-test.properties
index 662f112..7ba1633 100644
--- a/flink-runtime/src/test/resources/log4j-test.properties
+++ b/flink-runtime/src/test/resources/log4j-test.properties
@@ -22,7 +22,7 @@ log4j.rootLogger=OFF, console
 # Console (use 'console')
 # -----------------------------------------------------------------------------
 log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.flink.util.MavenForkNumberPrefixLayout
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
 
 # -----------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/flink/blob/478f5d18/tools/log4j-travis.properties
----------------------------------------------------------------------
diff --git a/tools/log4j-travis.properties b/tools/log4j-travis.properties
index 476cee3..4bc8ad0 100644
--- a/tools/log4j-travis.properties
+++ b/tools/log4j-travis.properties
@@ -22,7 +22,7 @@ log4j.rootLogger=INFO, file
 # Console (use 'console')
 # -----------------------------------------------------------------------------
 log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.flink.util.MavenForkNumberPrefixLayout
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
 log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n
 
 # -----------------------------------------------------------------------------


Mime
View raw message