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.
Below is the example of log:
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");
}
}
Output (correct) : 0 [main] FATAL TopologyMain - Here is some FATAL
But I require to change the logging configure of storm/zookeper,etc..
Could anyone please help on this?
//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 is really chatty and tells a lot of information but if you want to silence it, you can set Config.TOPOLOGY_DEBUG to false.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With