Working with Storm Topologies
Also available as:
PDF

Extending Event Logging

The Storm eventlogger bolt uses the IEventLogger interface to log events. The default implementation is aFileBasedEventLogger, which logs events to a log file at logs/workers-artifacts/<topology-id>/<worker-port>/events.log.

To extend event logging functionality (for example, to build a search index or log events to a database), add an alternate implementation of the IEventLogger interface.

/**
      * EventLogger interface for logging the event info to a sink like log file or db
      * for inspecting the events via UI for debugging.
      */public interface IEventLogger {
          void prepare(Map stormConf, TopologyContext context);
          /**
          * Invoked when the {@link EventLoggerBolt} receives a tuple from the spouts or bolts that
          * have event logging enabled.
          *
          * @param e the event
          */
          void log(EventInfo e);
          /**
          * Invoked when the event logger bolt is cleaned up
          */
          void close();
          }

See JIRA STORM-954 for more details.