Log-conf.xml TRACE

From Phobos Wiki
Jump to: navigation, search

Expand and copy the following XML to GWS->Conf->log-conf.xml. This will output the maximum information to telem-app console.log files.

/usr/local/etc/telem/log-conf.xml content for TRACE

<?xml version="1.0" encoding="UTF-8"?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="Console" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n"/>
        </layout>
    </appender>
    <appender name="ConsoleFile" class="org.apache.log4j.rolling.MartemRollingFileAppender">
        <param name="append" value="true"/>
        <param name="file" value="/var/local/telem/log/console.log"/>
        <param name="Threshold" value="TRACE"/>
        <param name="ImmediateFlush" value="false"/>
        <param name="BufferSize" value="8192"/>
        <param name="BufferedIO" value="true"/>
        <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
            <param name="FileNamePattern" value="/var/local/telem/log/console.%i.log"/>
            <param name="MaxIndex" value="10"/>
        </rollingPolicy>
        <triggeringPolicy class="org.apache.log4j.SizeBasedTriggeringPolicy">
            <param name="MaxFileSize" value="10MB"/>
        </triggeringPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%p] %c - %m%n"/>
        </layout>
    </appender>
    <appender name="LatestErrorsFile" class="org.apache.log4j.rolling.MartemRollingFileAppender">
        <param name="append" value="true"/>
        <param name="file" value="/var/local/telem/log/error.log"/>
        <param name="Threshold" value="ERROR"/>
        <param name="ImmediateFlush" value="false"/>
        <param name="BufferSize" value="8192"/>
        <param name="BufferedIO" value="true"/>
        <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
            <param name="FileNamePattern" value="/var/local/telem/log/error.%i.log"/>
            <param name="MaxIndex" value="1"/>
        </rollingPolicy>
        <triggeringPolicy class="org.apache.log4j.SizeBasedTriggeringPolicy">
            <param name="MaxFileSize" value="10KB"/>
        </triggeringPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %c - %m%n"/>
        </layout>
    </appender>
    <appender name="EventsCSV" class="org.apache.log4j.rolling.MartemRollingFileAppender">
        <param name="append" value="true"/>
        <param name="Threshold" value="DEBUG"/>
        <param name="file" value="/var/local/telem/log/events.csv"/>
        <param name="ImmediateFlush" value="false"/>
        <param name="BufferSize" value="8192"/>
        <param name="BufferedIO" value="true"/>
        <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
            <param name="FileNamePattern" value="/var/local/telem/log/events.%i.csv"/>
            <param name="MaxIndex" value="4"/>
        </rollingPolicy>
        <triggeringPolicy class="org.apache.log4j.SizeBasedTriggeringPolicy">
            <param name="MaxFileSize" value="5MB"/>
        </triggeringPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS};%m%n"/>
        </layout>
    </appender>
    <appender name="syslog" class="org.apache.log4j.net.SyslogAppender">
        <param name="append" value="true"/>
        <param name="Threshold" value="INFO"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{MMM dd HH:mm:ss} telem-gw: [%p] %c - %m%n"/>
        </layout>
        <param name="SyslogHost" value="127.0.0.1"/>
    </appender>
    <appender name="GpsLog" class="org.apache.log4j.rolling.MartemRollingFileAppender">
        <param name="append" value="true"/>
        <param name="file" value="/var/local/telem/log/gps.log"/>
        <param name="ImmediateFlush" value="false"/>
        <param name="BufferSize" value="8192"/>
        <param name="BufferedIO" value="true"/>
        <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
            <param name="FileNamePattern" value="/var/local/telem/log/gps.%i.log"/>
            <param name="MaxIndex" value="1"/>
        </rollingPolicy>
        <triggeringPolicy class="org.apache.log4j.SizeBasedTriggeringPolicy">
            <param name="MaxFileSize" value="300KB"/>
        </triggeringPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%p] %c - %m%n"/>
        </layout>
    </appender>
    <logger name="Gateway.Filter" additivity="false">
        <priority value="TRACE"/>
        <appender-ref ref="ConsoleFile"/>
    </logger>
    <logger name="Gateway.Formula" additivity="false">
        <priority value="TRACE"/>
        <appender-ref ref="ConsoleFile"/>
    </logger>
    <logger name="Gateway.HAL-gpio-fs" additivity="false">
        <priority value="OFF"/>
        <appender-ref ref="ConsoleFile"/>
    </logger>
    <logger name="Gateway.GWMIO" additivity="false">
        <priority value="TRACE"/>
        <appender-ref ref="ConsoleFile"/>
    </logger>
    <logger name="Gateway.Gps" additivity="false">
        <priority value="INFO"/>
        <appender-ref ref="GpsLog"/>
    </logger>
    <logger name="events_csv" additivity="false">
        <priority value="INFO"/>
        <appender-ref ref="EventsCSV"/>
    </logger>
    <logger name="Gateway.cmd" additivity="false">
        <priority value="INFO"/>
        <appender-ref ref="Console"/>
    </logger>
    <root>
        <priority value="TRACE"/>
        <appender-ref ref="LatestErrorsFile"/>
        <appender-ref ref="ConsoleFile"/>
        <!--<appender-ref ref="syslog"/>-->
    </root>
</log4j:configuration>