Port debugging: Difference between revisions

From Phobos Wiki
Jump to navigation Jump to search
(Uus lehekülg: 'To send port's raw data to some specific file, modify your devices logging configuration. Location: /usr/local/etc/telem/log-conf.xml <syntaxhighlight lang="xml"> <?xml versio...')
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
To send port's raw data to some specific file, modify your devices logging configuration.
To send port's raw data to some specific file, modify your devices logging configuration.


  Location: /usr/local/etc/telem/log-conf.xml
  Location: /usr/local/etc/telem/log-conf.xml
modify: nano /usr/local/etc/telem/log-conf.xml
df -h: disk free
Copy to file: log-conf.xml


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 7: Line 12:
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


<!--A bunch of predefined appenders and loggers-->
<!-- A bunch of predefined appenders and loggers -->


<!--Port debug start-->
<!-- Port debug start -->


<!-- Set target filename, rolling policy and text pattern in log file -->
<!-- Set target filename, rolling policy and text pattern in log file -->
<appender name="Port6Log" class="org.apache.log4j.rolling.RollingFileAppender">
<appender name="PortLog" class="org.apache.log4j.rolling.RollingFileAppender">
     <param name="append" value="true"/>
     <param name="append" value="true"/>
     <param name="file" value="/var/local/telem/log/port.log"/>
     <param name="file" value="/var/local/telem/log/port.log"/>
Line 23: Line 28:
     </triggeringPolicy>
     </triggeringPolicy>
     <layout class="org.apache.log4j.PatternLayout">
     <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} - %m%n"/>
         <param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %c - %m%n"/>
     </layout>
     </layout>
</appender>
</appender>


<!-- Bind logger 'Gateway.Port6.port' to appender 'Port6Log' -->
<!-- Bind logger to appender 'PortLog'  -->
<logger name="Gateway.Port6.port" additivity="false">
<!-- 'PortCommentInConfiguration' is the text you have specified in GWS for specific port's comment -->
<logger name="Gateway.PortCommentInConfiguration.port" additivity="false">
     <priority value="all"/>
     <priority value="all"/>
     <appender-ref ref="Port6Log"/>
     <appender-ref ref="PortLog"/>
</logger>
</logger>



Latest revision as of 13:14, 13 December 2013

To send port's raw data to some specific file, modify your devices logging configuration.


Location: /usr/local/etc/telem/log-conf.xml
modify: nano /usr/local/etc/telem/log-conf.xml 
df -h: disk free
Copy to file: log-conf.xml


<?xml version="1.0" encoding="UTF-8"?>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<!-- A bunch of predefined appenders and loggers -->

<!-- Port debug start -->

<!-- Set target filename, rolling policy and text pattern in log file -->
<appender name="PortLog" class="org.apache.log4j.rolling.RollingFileAppender">
    <param name="append" value="true"/>
    <param name="file" value="/var/local/telem/log/port.log"/>
    <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
        <param name="FileNamePattern" value="/var/local/telem/log/port.%i.log"/>
        <param name="MaxIndex" value="5"/>
    </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} %c - %m%n"/>
    </layout>
</appender>

<!-- Bind logger to appender 'PortLog'  -->
<!-- 'PortCommentInConfiguration' is the text you have specified in GWS for specific port's comment -->
<logger name="Gateway.PortCommentInConfiguration.port" additivity="false">
    <priority value="all"/>
    <appender-ref ref="PortLog"/>
</logger>

<!--Port debug end-->

</log4j:configuration>