You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/07 14:54:29 UTC

[GitHub] [flink] zentol commented on a change in pull request #14304: [FLINK-20353][docs][logging] Update logging documentation

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



##########
File path: docs/deployment/advanced/logging.md
##########
@@ -23,30 +23,39 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-The logging in Flink is implemented using the slf4j logging interface. As underlying logging framework, log4j2 is used. We also provide logback configuration files and pass them to the JVM's as properties. Users willing to use logback instead of log4j2 can just exclude log4j2 (or delete it from the lib/ folder).
+All Flink processes create a log text file that contains messages for various events happening in that process.
+These logs provide deep insights into the inner workings of Flink, and can be used to detect problems (in the form of WARN/ERROR messages) and can help in debugging them.
+
+The log files can be accessed via the Job-/TaskManager pages of the WebUI. The used [Resource Provider]({% link deployment/resource-providers/index.md %}) (e.g., YARN) may provide additional means of accessing them.
+
+The logging in Flink uses the [SLF4J](http://www.slf4j.org/) logging interface.
+This allows you to use any logging framework that supports SLF4J, without having to modify the Flink source code.
+
+By default, [Log4j 2](https://logging.apache.org/log4j/2.x/index.html) is used as the underlying logging framework.
 
 * This will be replaced by the TOC
 {:toc}
 
-## Configuring Log4j2
+## Configuring Log4j 2
 
-Log4j2 is controlled using property files. In Flink's case, the file is usually called `log4j.properties`. We pass the filename and location of this file using the `-Dlog4j.configurationFile=` parameter to the JVM.
+Log4j 2 is controlled using property files.
 
-Flink ships with the following default properties files:
+The Flink distribution ships with the following log4j properties files in the `conf` directory, which are used automatically if log4j 2 is enabled:
 
-- `log4j-cli.properties`: Used by the Flink command line client (e.g. `flink run`) (not code executed on the cluster)
-- `log4j-session.properties`: Used by the Flink command line client when starting a YARN or Kubernetes session (`yarn-session.sh`, `kubernetes-session.sh`)
-- `log4j.properties`: JobManager/Taskmanager logs (both standalone and YARN)
+- `log4j-cli.properties`: used by the command line interface (e.g., `flink run`)
+- `log4j-session.properties`: used by the command line interface when starting a Kubernetes/Yarn session cluster (i.e., `kubernetes-session.sh`/`yarn-session.sh`)
+- `log4j-console.properties`: used for Job-/TaskManagers if they are run in the foreground (e.g., Kubernetes)
+- `log4j.properties`: used for Job-/TaskManagers by default
 
-### Compatibility with Log4j1
+### Compatibility with Log4j 1
 
 Flink ships with the [Log4j API bridge](https://logging.apache.org/log4j/log4j-2.2/log4j-1.2-api/index.html), allowing existing applications that work against Log4j1 classes to continue working.
 
-If you have custom Log4j1 properties files or code that relies on Log4j1, please check out the official Log4j [compatibility](https://logging.apache.org/log4j/2.x/manual/compatibility.html) and [migration](https://logging.apache.org/log4j/2.x/manual/migration.html) guides.
+If you have custom Log4j 1 properties files or code that relies on Log4j 1, please check out the official Log4j [compatibility](https://logging.apache.org/log4j/2.x/manual/compatibility.html) and [migration](https://logging.apache.org/log4j/2.x/manual/migration.html) guides.
 
 ## Configuring Log4j1
 
-To use Flink with Log4j1 you must ensure that:
+To use Flink with [Log4j 1](https://logging.apache.org/log4j/1.2/) you must ensure that:
 - `org.apache.logging.log4j:log4j-core`, `org.apache.logging.log4j:log4j-slf4j-impl` and `org.apache.logging.log4j:log4j-1.2-api` are not on the classpath,
 - `log4j:log4j`, `org.slf4j:slf4j-log4j12`, `org.apache.logging.log4j:log4j-to-slf4j` and `org.apache.logging.log4j:log4j-api` are on the classpath.

Review comment:
       no.
   Semantically, log4j:log4j is equivalent to the union of org.apache.logging.log4j:log4j-core and org.apache.logging.log4j:log4j-api .
   The packages for all classes are also different (org.apache.log4j vs org.apache.logging.log4j)




----------------------------------------------------------------
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:
users@infra.apache.org