I'm trying to get started with Apache storm by running the example code. I'm working with storm 0.10.1-beta1 off of a maven repository.
Unfortunately, when I run these, the console is flooded with info level logs, drowning out any System.out.print()
calls that I've added. Is it possible to change the log level when running off of a LocalCluster? I've tried the solutions listed here and none of the solutions seem to be working.
From the link, Changing the Config.TOPOLOGY_DEBUG
property to false doesn't remove the info level logs, and using the code from the link, I can't even use logger.setLevel((Level) Level.FATAL)
as I get "The method setLevel(Level) is undefined for the type Logger" despite it clearly being listed in the log4j api.
Edit 1:
I also tried the solution here and I put an xml called logback.xml
into ./src with the following config:
<configuration monitorInterval="60">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%-4r [%t] %-5p %c{1.} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="org.apache.zookeeper" level="WARN"/>
<Root level="WARN">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</configuration>
Still no luck though. Is there any additional config required to tell storm to use the custom log settings?
Update: It turns out that storm 0.10.x switched to using log4j2 instead of logback, so adding a log4j2.xml with the configuration above finally worked!
The following configuration works for me:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>
</configuration>
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