zentol commented on a change in pull request #14304:
URL: https://github.com/apache/flink/pull/14304#discussion_r538540769



##########
File path: docs/deployment/advanced/logging.md
##########
@@ -59,49 +71,47 @@ For Flink distributions this means you have to
 
 ## Configuring logback
 
-For users and developers alike it is important to control the logging 
framework.
-The configuration of the logging framework is exclusively done by 
configuration files.
-The configuration file either has to be specified by setting the environment 
property `-Dlogback.configurationFile=<file>` or by putting `logback.xml` in 
the classpath.
-The `conf` directory contains a `logback.xml` file which can be modified and 
is used if Flink is started outside of an IDE and with the provided starting 
scripts.
-The provided `logback.xml` has the following form:
-
-{% highlight xml %}
-<configuration>
-    <appender name="file" class="ch.qos.logback.core.FileAppender">
-        <file>${log.file}</file>
-        <append>false</append>
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{60} 
%X{sourceThread} - %msg%n</pattern>
-        </encoder>
-    </appender>
-
-    <root level="INFO">
-        <appender-ref ref="file"/>
-    </root>
-</configuration>
-{% endhighlight %}
+To use Flink with [logback](https://logback.qos.ch/) you must ensure that:
+- `org.apache.logging.log4j:log4j-slf4j-impl` is not on the classpath,
+- `ch.qos.logback:logback-core` and `ch.qos.logback:logback-classic` are on 
the classpath.
 
-In order to control the logging level of 
`org.apache.flink.runtime.jobgraph.JobGraph`, for example, one would have to 
add the following line to the configuration file.
+In the IDE this means you have to replace such dependencies defined in your 
pom, and possibly add exclusions on dependencies that transitively depend on 
them.
 
-{% highlight xml %}
-<logger name="org.apache.flink.runtime.jobgraph.JobGraph" level="DEBUG"/>
-{% endhighlight %}
+For Flink distributions this means you have to
+- remove the `log4j-slf4j-impl` jar from the `lib` directory,
+- add the `logback-core`, and `logback-classic` jars to the `lib` directory.
+
+The Flink distribution ships with the following logback configuration files in 
the `conf` directory, which are used automatically if logback is enabled:
+- `logback-session.properties`: used by the command line interface when 
starting a Kubernetes/Yarn session cluster (i.e., 
`kubernetes-session.sh`/`yarn-session.sh`)
+- `logback-console.properties`: used for Job-/TaskManagers if they are run in 
the foreground (e.g., Kubernetes)
+- `logback.xml`: used for command line interface and Job-/TaskManagers by 
default
 
-For further information on configuring logback see [LOGback's 
manual](http://logback.qos.ch/manual/configuration.html).
+<div class="alert alert-info" markdown="span">
+  <strong>Note:</strong> Logback 1.3+ requires SLF4J 2, which is currently not 
supported.
+</div>
 
 ## Best practices for developers
 
-The loggers using slf4j are created by calling
+You can create an SLF4J logger by calling 
`org.slf4j.LoggerFactory#LoggerFactory.getLogger` with the `Class` of your 
class as an argument.
+
+We highly recommend storing this logger in a `private static final` field.
 
 {% highlight java %}
 import org.slf4j.LoggerFactory
 import org.slf4j.Logger

Review comment:
       good idea




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to