Apache Storm Component Guide
Also available as:
loading table of contents...

Enabling Dynamic Log Levels

Storm allows users and administrators to dynamically change the log level settings of a running topology. You can change log level settings from either the Storm UI or the command line. No Storm processes need to be restarted for the settings to take effect. The resulting log files are searchable from the Storm UI and logviewer service.

Standard log4j levels include DEBUG, INFO, WARN, ERROR, and FATAL, specifying logging of coarse or finer-grained levels of informational messages and error events. Inheritance is consistent with log4j behavior. For example, if you set the log level of a parent logger, the child loggers start using that level (unless the children have a more restrictive level defined for them).

Setting and Clearing Log Levels Using the Storm UI

To set log level from the Storm UI:

  1. Click on a running topology.

  2. Click on “Change Log Level” in the Topology Actions section:

  3. For an existing logger, select the desired log level for the logger. Alternately, add a logger and set the desired log level.

  4. Optionally, specify a timeout value in seconds, after which changes will be reverted automatically. Specify 0 if no timeout is needed.

  5. Click "Apply".

The preceding example sets the log4j log level to ERROR for the root logger, and to DEBUG for storm.starter. Logging for the root logger will be limited to error events, and finer-grained informational events (useful for debugging the application) will be recorded for storm.starter packages.

To clear (reset) a log level setting using the Storm UI, click on the “Clear” button. This reverts the log level back to what it was before you added the setting. The log level line will disappear from the UI.

Setting and Clearing Log Levels Using the CLI

To set log level from the command line, use the following command:

./bin/storm set_log_level [topology name] -l [logger name]=[LEVEL]:[TIMEOUT]

The following example sets the ROOT logger to DEBUG for 30 seconds:

./bin/storm set_log_level my_topology -l ROOT=DEBUG:30

To clear (reset) the log level using the CLI, use the following command. This reverts the log level back to what it was before you added the setting.

./bin/storm set_log_level [topology name] -r [logger name]

The following example clears the ROOT logger dynamic log level, resetting it to its original value:

./bin/storm set_log_level my_topology -r ROOT

For more information, see Apache STORM-412.