Logging data - Storm Streaming Server

You can easily configure the way Storm Server logs most important operations and errors. To do so, please edit the config/log4j.xml file. The configuration will proceed like this:

                                
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
	<Appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1} - %m%n"/>
		</Console>

		<RollingFile name="File" fileName="PATH_TO_LOG_DIRECTORY/log.log" filePattern="PATH_TO_LOG_DIRECTORY/log.%d{MM-dd-yyyy-HH-mm}.%i.log" ignoreExceptions="false">
		    <PatternLayout>
		        <Pattern>%d{yyyy-MM-dd HH:mm:ss} %p %m%n</Pattern>
		    </PatternLayout>
		    <Policies>
		        <OnStartupTriggeringPolicy />
		        <SizeBasedTriggeringPolicy size="10240 KB" />
		        <TimeBasedTriggeringPolicy />
		    </Policies>
		    <DefaultRolloverStrategy>
		        <Delete basePath="PATH_TO_LOG_DIRECTORY/log" maxDepth="2">
		            <IfFileName glob="app.*.log" />
		            <IfLastModified age="20d" />
		        </Delete>
		    </DefaultRolloverStrategy>
		</RollingFile>

	</Appenders>
	<Loggers>
    	<Root level="All">
      		<AppenderRef ref="Console"/>
      		<AppenderRef ref="File"/>
    	</Root>
	</Loggers>
</Configuration>
                            

Log levels

To limit the number of logs generated by the server, you can modify which log levels are displayed/saved.

                                
<Loggers>
    <Root level="All">
        <AppenderRef ref="Console"/>
        <AppenderRef ref="File"/>
    </Root>
</Loggers>
                            

Instead of “ALL” value level you can use:

OFFNo logs will be saved or displayed
FATALOnly logs related to server shutdown or malfunction
ERRORError in code execution
WARNInformation regarding potential problems
INFOInformation regarding current server operations
DEBUGNot recommended – for Debug only
TRACENot recommended – for Development only
Table 1. Log level values table