简体   繁体   English

如何在运行时更改apache flink的日志级别

[英]how to change the log level of apache flink at runtime

Is it possible to change the log level of the flink framework at runtime?是否可以在运行时更改 flink 框架的日志级别? when flink cluster is already running?当 flink 集群已经在运行时? I referred to the below document there is no such mention about it我参考了下面的文件,没有提到它

https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/logging.html

In the program code, Flink uses SLF4J for logging and supports log4j (log4j2 for Flink>= 1.11, log4j < 1.11) and Logback as underlying logging frameworks, which can be freely configured via their respective .properties files.在程序代码中,Flink 使用 SLF4J 进行日志记录,支持 log4j(log4j2 for Flink>=1.11,log4j < 1.11)和 Logback 作为底层日志框架,可以通过各自的 .properties 文件自由配置。

As far as I can tell, SLF4J itself doesn't support changing the logging level at runtime and in Flink itself, I see no custom code related to the underlying logging framework like log4j or logback which would change the loglevel via some mechanism like a REST API.据我所知,SLF4J 本身不支持在运行时更改日志级别,而在 Flink 本身中,我没有看到与底层日志框架相关的自定义代码,如 log4j 或 logback,它们会通过某种机制(如 REST)更改日志级别应用程序接口。

That said, the log framework itself might allow for some mechanism to change the log level at runtime.也就是说,日志框架本身可能允许某种机制在运行时更改日志级别。 On a short google search, I find that for instance log4j has some mechanisms included eg by using File Watchdog and reload logging properties files at runtime, see for example here: Dynamically Changing log4j log level Of course, you would need to build the tooling around that yourself, ie find out where your TaskManagers and JobManagers are running, have their working directory and provide/edit the files accordingly.在简短的谷歌搜索中,我发现例如 log4j 包含一些机制,例如通过在运行时使用文件看门狗和重新加载日志属性文件,请参见此处的示例: 动态更改 log4j 日志级别当然,您需要构建工具你自己,即找出你的 TaskManagers 和 JobManagers 在哪里运行,拥有它们的工作目录并相应地提供/编辑文件。

Conclusion: I'd suggest you to stop your job with a savepoint, change the logging properties and restart the job.结论:我建议您使用保存点停止作业,更改日志记录属性并重新启动作业。 That's probably the easier way to go..这可能是更简单的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 更改容器运行时的日志级别 - Change log level on runtime for containers 如何在运行时更改特定用户/线程的日志级别 - How to Change log level for particular users/threads at runtime 如何在运行时更改 AWS Lambdas(NodeJS) 的日志级别? - How to change the log level of AWS Lambdas(NodeJS) at runtime? 设置 Apache Storm 和 Flink 日志级别以显示调试消息 - Set Apache Storm and Flink log level to display debug messages 是否可以在运行时更改 AWS Lambda 的日志级别? - Is it possible to change the log level of an AWS Lambda at runtime? 更改Tomcat 7下Apache Jackrabbit的日志级别 - Change log level for Apache Jackrabbit under Tomcat 7 如何在运行时更改日志级别而不重新启动Vert.x应用程序 - How do I change log level in runtime without restarting Vert.x application 如何在不重新启动 Spring Boot 应用程序的情况下在运行时更改日志级别 - how do I change log level in runtime without restarting spring boot application 如何更改spark中的日志级别? - How to change log level in spark? 如何在java.util.logging中获取记录器,以便我可以在运行时更改其日志级别? - How to get loggers in java.util.logging so i can change their log level at runtime?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM