从开始设置风暴拓扑的日志级别 [英] Set Log Level of Storm Topology from Start

查看:85
本文介绍了从开始设置风暴拓扑的日志级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在初始化期间,我的Storm拓扑中发生了一个错误.我想从启动拓扑时开始将日志级别设置为DEBUG.

I have a bug that occurs in my Storm topology during initialization. I would like to set the log level to DEBUG from when the topology is started.

我意识到有一种机制可以使用Storm UI或CLI为正在运行的拓扑动态设置日志级别,但是在初始化期间拓扑中的错误发生之前,我无法动态更改此设置.

I realize there is a mechanism to dynamically set the log level for a running topology using either the Storm UI or CLI, but I am not able to dynamically change this setting before the bug occurs in my topology during initialization.

如何将日志级别静态设置为DEBUG,以便在初始化拓扑时看到更详细的日志?

How can I statically set the log level to DEBUG so that I can see more detailed logs when my topology is initialized?

推荐答案

以下内容仅适用于Storm 2.0.0及更高版本.

The following only applies to Storm 2.0.0 and later.

您可以在拓扑jar中包含一个log4j2配置文件.然后,您需要在拓扑配置中设置topology.logging.config属性.

You can include a log4j2 config file in your topology jar. You then need to set the topology.logging.config property in your topology configuration.

为方便起见,我将在此处提供文档:

I'll include the documentation here for convenience:

用户可用来配置Log4j2的日志文件.可以是jar中的资源(由classpath:/path/to/resource指定)或文件.除了常规工作程序log4j2配置之外,还应用了此配置.根据此处的规则合并配置: https://logging.apache.org/log4j/2.x/manual/configuration.html#CompositeConfiguration

请参见常规工作程序log4j2配置"是Storm部署中的log4j2/worker.xml文件,假定使用默认设置.

The "regular worker log4j2 configuration" is the log4j2/worker.xml file in your Storm deployment, assuming default settings.

这篇关于从开始设置风暴拓扑的日志级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆