如何禁用/关闭 Storm 的日志记录功能 [英] How to disable/turn off the logging feature from Storm

查看:35
本文介绍了如何禁用/关闭 Storm 的日志记录功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们从本地集群运行时,我想关闭默认提供的日志记录功能.目前它在控制台上记录了这么多信息.

I want to turn off the logging feature offered by default when we run from local cluster. Currently its logging so many information on the console.

下面是日志的例子:

261 [main] INFO  backtype.storm.daemon.task  - Shut down task Getting-Started-Toplogie-1-1376388324:2
2261 [main] INFO  backtype.storm.daemon.task  - Shutting down task Getting-Started-Toplogie-1-1376388324:1
2262 [Thread-24] INFO  backtype.storm.util  - Async loop interrupted!
2276 [main] INFO  backtype.storm.daemon.task  - Shut down task Getting-Started-Toplogie-1-1376388324:1
2278 [main] INFO  backtype.storm.daemon.worker  - Terminating zmq context
2279 [main] INFO  backtype.storm.daemon.worker  - Disconnecting from storm cluster state context
2279 [main] INFO  backtype.storm.daemon.worker  - Waiting for heartbeat thread to die
2279 [Thread-27] INFO  backtype.storm.util  - Async loop interrupted!
2308 [main] INFO  backtype.storm.testing  - Shutting down in process zookeeper
2309 [main] INFO  backtype.storm.testing  - Done shutting down in process zookeeper
2309 [main] INFO  backtype.storm.testing  - Deleting temporary path /tmp/255fe7c8-1407-4f43-8771-2217905232ab

在浏览了许多文档后,我最终得到了以下代码,我可以从课堂中关闭日志记录.

After going through many docs, I ended up with the below code, I am able to turn off the logging from within class.

static Logger logger = Logger.getLogger(TopologyMain.class);

public static void main(String[] args) throws InterruptedException, AlreadyAliveException, InvalidTopologyException {        
      logger.setLevel((Level) Level.FATAL);
      logger.debug("Here is some DEBUG");
      logger.info("Here is some INFO");
      logger.warn("Here is some WARN");
      logger.error("Here is some ERROR");
      logger.fatal("Here is some FATAL");
 }
}

输出(正确):0 [main] FATAL TopologyMain - 这是一些 FATAL

但是我需要更改storm/zookeper等的日志配置.

But I require to change the logging configure of storm/zookeper,etc..

有人可以帮忙吗?


更新:以下是我尝试过的代码,但不起作用.我尝试使用 0.7.1、0.8.2 & 版本0.9.0-wip*


Update: The following is the code I tried, but it does not work. I tried with version 0.7.1, 0.8.2 & 0.9.0-wip*

        //Configuration
        Config conf = new Config();
        conf.put(Config.TOPOLOGY_DEBUG, false);  //Tried this alone
        conf.setDebug(false);  //Tried this alone & tried both together as well.. No change :-(

推荐答案

Storm 真的很健谈,讲了很多信息,但如果你想让它静音,你可以设置 Config.TOPOLOGY_DEBUG 为假.

Storm is really chatty and tells a lot of information but if you want to silence it, you can set Config.TOPOLOGY_DEBUG to false.

当您将 Config.TOPOLOGY_DEBUG 设置为 true 时,您是在告诉 Storm 每次从任何 spout 或 bolt 发出元组时都记录一条消息.

When you set Config.TOPOLOGY_DEBUG to true, you are telling Storm to log a message every time a tuple is emitted from any spout or bolt.

这篇关于如何禁用/关闭 Storm 的日志记录功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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