This is the log back appended config. 

Here you can see the different loggers that are used, where the log is saved, 
what the file name should be and if rotation should be used. 

I would recommend looking at the log back website to read about the config 
files. 

Best Regards
Matthew Lowe

> On 30 May 2016, at 03:48, Joaquin Menchaca <[email protected]> wrote:
> 
> I was wondering what this is used for and why popular sample configs, like 
> viki, wurstmeister, ptgoetz use it?  I did look through docs, didn't find it.
> 
> Example:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <configuration scan="true" scanPeriod="60 seconds">
>  <appender name="A1" class="ch.qos.logback.core.rolling.RollingFileAppender">
>     <file>/var/log/storm/${logfile.name}</file>
>     <rollingPolicy 
> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
>       <fileNamePattern>/var/log/storm/${logfile.name}.%i</fileNamePattern>
>       <minIndex>1</minIndex>
>       <maxIndex>9</maxIndex>
>     </rollingPolicy>
> 
>     <triggeringPolicy 
> class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
>       <maxFileSize>100MB</maxFileSize>
>     </triggeringPolicy>
> 
>     <encoder>
>       <pattern>%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n</pattern>
>     </encoder>
>  </appender>
> 
>  <appender name="ACCESS" 
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>     <file>/var/log/storm/access.log</file>
>     <rollingPolicy 
> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
>       <fileNamePattern>/var/log/storm/access.log.%i</fileNamePattern>
>       <minIndex>1</minIndex>
>       <maxIndex>9</maxIndex>
>     </rollingPolicy>
> 
>     <triggeringPolicy 
> class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
>       <maxFileSize>100MB</maxFileSize>
>     </triggeringPolicy>
> 
>     <encoder>
>       <pattern>%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n</pattern>
>     </encoder>
>   </appender>
> 
>   <appender name="METRICS" 
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>     <file>/var/log/storm/metrics.log</file>
>     <rollingPolicy 
> class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
>       <fileNamePattern>metrics.log.%i</fileNamePattern>
>       <minIndex>1</minIndex>
>       <maxIndex>9</maxIndex>
>     </rollingPolicy>
> 
>     <triggeringPolicy 
> class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
>       <maxFileSize>2MB</maxFileSize>
>     </triggeringPolicy>
> 
>     <encoder>
>       <pattern>%d %-8r %m%n</pattern>
>     </encoder>
>   </appender>
> 
>   <root level="INFO">
>     <appender-ref ref="A1"/>
>   </root>
>   
>   <logger name="backtype.storm.messaging.netty">
>     <level value="WARN" />
>     <appender-ref ref="A1" />
>   </logger>
>   
>   <logger name="backtype.storm">
>     <level value="DEBUG" />
>     <appender-ref ref="A1" />
>   </logger>
> 
>   <logger name="backtype.storm.security.auth.authorizer" additivity="false">
>     <level value="INFO" />
>     <appender-ref ref="ACCESS" />
>   </logger>
> 
>   <logger name="backtype.storm.metric.LoggingMetricsConsumer" 
> additivity="false" >
>     <level value="INFO"/>
>     <appender-ref ref="METRICS"/>
>   </logger>
> 
> </configuration>
> 
> 
> -- 
> 
> 是故勝兵先勝而後求戰,敗兵先戰而後求勝。

Reply via email to