zentol commented on a change in pull request #11073: [FLINK-15672][build]
Migrate to log4j2
URL: https://github.com/apache/flink/pull/11073#discussion_r381340360
##########
File path: docs/ops/deployment/native_kubernetes.zh.md
##########
@@ -134,15 +134,16 @@ By default, the JobManager and TaskManager only store
logs under `/opt/flink/log
If you want to use `kubectl logs <PodName>` to view the logs, you must perform
the following:
1. Add a new appender to the log4j.properties in the Flink client.
-2. Update the rootLogger in log4j.properties to `log4j.rootLogger=INFO, file,
console`.
+2. Add the following 'appenderRef' the rootLogger in log4j.properties
`rootLogger.appenderRef.console.ref = ConsoleAppender`.
3. Remove the redirect args by adding config option
`-Dkubernetes.container-start-command-template="%java% %classpath% %jvmmem%
%jvmopts% %logging% %class% %args%"`.
4. Stop and start your session again. Now you could use `kubectl logs` to view
your logs.
{% highlight bash %}
# Log all infos to the console
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}
%-5p %-60c %x - %m%n
+appender.console.name = org.apache.log4j.ConsoleAppender
+appender.console.type = CONSOLE
Review comment:
I will adjust the type in `log4j-cli.properties`
----------------------------------------------------------------
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]
With regards,
Apache Git Services