From a5894677d95336a67d5539584b9204bcdd14fac5 Mon Sep 17 00:00:00 2001 From: Chesnay Schepler Date: Sat, 15 Feb 2020 10:20:37 +0100 Subject: [PATCH] [hotfix][docs][conf] Setup logging for generator --- flink-docs/pom.xml | 2 ++ .../ConfigOptionsDocGenerator.java | 5 ++++ .../src/main/resources/log4j.properties | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 flink-docs/src/main/resources/log4j.properties diff --git a/flink-docs/pom.xml b/flink-docs/pom.xml index cc4e47bb57c4e..7272428652847 100644 --- a/flink-docs/pom.xml +++ b/flink-docs/pom.xml @@ -123,10 +123,12 @@ under the License. org.slf4j slf4j-log4j12 + compile log4j log4j + compile diff --git a/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java b/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java index 7e5f9c4310e7d..25c7bd734ca72 100644 --- a/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java +++ b/flink-docs/src/main/java/org/apache/flink/docs/configuration/ConfigOptionsDocGenerator.java @@ -29,6 +29,9 @@ import org.apache.flink.util.TimeUtils; import org.apache.flink.util.function.ThrowingConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -59,6 +62,8 @@ */ public class ConfigOptionsDocGenerator { + private static final Logger LOG = LoggerFactory.getLogger(ConfigOptionsDocGenerator.class); + static final OptionsClassLocation[] LOCATIONS = new OptionsClassLocation[]{ new OptionsClassLocation("flink-core", "org.apache.flink.configuration"), new OptionsClassLocation("flink-runtime", "org.apache.flink.runtime.shuffle"), diff --git a/flink-docs/src/main/resources/log4j.properties b/flink-docs/src/main/resources/log4j.properties new file mode 100644 index 0000000000000..517550a13dfe7 --- /dev/null +++ b/flink-docs/src/main/resources/log4j.properties @@ -0,0 +1,24 @@ +################################################################################ +# 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. +################################################################################ + +log4j.logger.org.apache.flink.docs.configuration.ConfigOptionsDocGenerator= INFO, logger + +log4j.appender.logger=org.apache.log4j.ConsoleAppender +log4j.appender.logger.target = System.out +log4j.appender.logger.layout=org.apache.log4j.PatternLayout +log4j.appender.logger.layout.ConversionPattern=%-5p - %m%n