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
I found this question when attempting to evaluate Storm using a local testing environment. I created a project depending on storm-core
version 1.1.0
, which is the latest stable release at the time of this writing, so I don't know if this applies for anyone else.
Inspecting the Maven dependencies, and expanding the contents of the storm-core-1.1.0.jar
revealed that the configuration file for the library's log4j logging dependency was called log4j2.xml
. With the realization that the logging mechanism was log4j 2 , I consulted the documentation here: https://logging.apache.org/log4j/2.x/manual/index.html I created a new log4j2.xml
file under src/main/resources
(my project is Maven-configured, so this is at the classpath root). I started by copying the contents of the existing file, and changing the log levels for the specified loggers to "OFF":
Running a "hello world" example, regardless of the setting of conf.debug()
indicates that - since there is now no mechanism by which logging should be possible at all - the logs (most usefully System.out) are now dead silent, except for the invocations of System.out.println()
I placed in my test spouts / bolts. This is exactly what I wanted! Hopefully this helps someone other than me!