0

I want to use tranquility and its Storm Bolt to send data to druid.So I wrote a storm topology(with dependency of tranquility) and compile it to a jar file, then use run storm with that jar file in local mode. Yet I came across problems: the storm bolt show's nothing wrong and the druid's overlord node log nothing. I feel like the overlord had not received data send by storm bolt.

I want to find out the problem. I did enable storm config's debug

conf.setDebug(true);

but it just show detailed information of every spout and bolt, it does not show tranquility's debug log info. I tried change storm's logback/cluster.xml to

<root level="DEBUG">
  <appender-ref ref="A1"/>
</root>

But it seems do not work. I try add a log4j.xml in my project's top directory:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
    xmlns:log4j='http://jakarta.apache.org/log4j/'>

    <appender name="console" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" 
          value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" />
        </layout>
    </appender>

    <root>
        <level value="DEBUG" />
        <appender-ref ref="console" />
    </root>

</log4j:configuration>

It does not work too.

I make some digging in tranquility's source code, and see tranquility depend on ladylog library which depend on log4j, so I thought adding a log4j.xml in project would enable the debug mode and can see the debug output of this BeamBot

I am totally confused, because now I wrote a jar that use tranquiity library which use loglady library which use log4j and my jar that run by storm which use logback. Could anyone give me some suggestions?

Matthias J. Sax
  • 59,682
  • 7
  • 117
  • 137
Allan Ruin
  • 5,229
  • 7
  • 37
  • 42

1 Answers1

0

then use run storm with that jar file in local mode

Since you run the jar file in local mode, it makes no sense to modify logback/cluster.xml. Generally, Storm will read default configurations from the specific dependency like storm-core-0.9.4.jar under local mode, unless you change configurations manually in your topology. You should run you topology in cluster mode to have a try.

On the other hand, since there are many conflicting problems with log4j, we use slf4j as the default library for log4j like this

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyBolt {
    private static final Logger LOG = LoggerFactory
            .getLogger(MyBolt.class);
}

and excludes all other log4j libs in all dependencies like this

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_2.10</artifactId>
    <version>0.8.2.1</version>
    <scope>provided</scope>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
        <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Hope this helps.

Yohn
  • 580
  • 5
  • 19