user17022777
user17022777

Reputation:

How do I set log level in stormcrawler/storm local?

I am running stormcrawler 2.8 in local mode (storm local...). I wish to wind down the amount of logging, changing the level to WARN or ERROR.

I have tried editing the storm worker.XML but that does nothing (nor does cluster.XML but that's not surprising as I'm running local). I tried adding a log4j2.xml into the resources directory, that too, does nothing. I also tried running storm set_log_level but that does not work (it's looking for a cluster I suspect).

So how do I change logging level with storm local?

Upvotes: 0

Views: 49

Answers (1)

user17022777
user17022777

Reputation:

I got this working using:

$export STORM_JAR_JVM_OPTS=" -Dlog4j.configurationFile=/path/to/log4j2.xml "

and having a log4j2.xml something like:

<Configuration>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
    </Appenders>
    
    <Loggers>
        <Root level="ERROR">
            <AppenderRef ref="Console"/>
        </Root>
        <Logger name="org.apache.storm" level="ERROR"/>
        <Logger name="org.apache.zookeeper" level="ERROR"/>
    </Loggers>
</Configuration>

Upvotes: 1

Related Questions