如何从Storm禁用/关闭日志记录功能

Amol M Kulkarni:

我要关闭从本地群集运行时默认提供的日志记录功能。当前,它在控制台上记录了很多信息。

以下是日志示例:

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

在阅读了许多文档之后,我得到了以下代码,我可以从类中关闭日志记录。

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 - Here is some FATAL

但是我需要更改Storm / zookeper等的日志记录配置。

有人可以帮忙吗?


更新 :以下是我尝试过的代码,但是它不起作用。我尝试使用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 :-(
凯龙(Chiron):

Storm确实很健谈,可以提供很多信息,但是如果您想使其静音,可以将Config.TOPOLOGY_DEBUG设置为false。

当您将Config.TOPOLOGY_DEBUG设置为true时,您在告诉Storm每次从任何喷嘴或螺栓发射出元组时都记录一条消息。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章