Logging

The Web Interface V6.0 Server Program and Folder Monitoring Service can log information to files and the console. Because Apache's Log4j library is used, the output destination and the output level of the log can easily be changed. If a custom log configuration file is not specified the default logging behavior is to print DEBUG level messages to both [install directory]/logs/[xds | folder-monitor].log and the console.

The Log4j configuration uses a xml file. The log4j2.xml setting file in installation directory will be used as default. You can specify custom log configuration file by using the -D Java virtual machine option.

  -Dlog4j.configurationFile=C:\test\log4j2.xml

The following is an example of the configuration file in xml format. Data form a tree structure by elements and attributes. Refer to Log4j for detailed information.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    
    <Properties>
        <Property name="format" value="%d [%t] %-5p %c{1} - %m%n"/> 
        <Property name="fileName" value="/usr/AXDSV60/server/logs/xds.log"/> 
        <Property name="archiveFileName" value="/usr/AXDSV60/server/logs/xds-%i.log"/> 
    </Properties>

    <Appenders>
        <!-- console log  -->
        <Console name="console" target="SYSTEM_OUT">
            <PatternLayout pattern="${format}"/>
        </Console>

        <!-- logfile and archive -->
        <RollingFile name="logfile" append="true" fileName="${fileName}"
                 filePattern="${archiveFileName}">
            <PatternLayout>
                <Pattern>${format}</Pattern>
            </PatternLayout>
            <Policies>
                <SizeBasedTriggeringPolicy size="3MB"/>
            </Policies>
            <DefaultRolloverStrategy max="8"/>
        </RollingFile>
    </Appenders>
    
    <Loggers>
        <Root level="DEBUG">
          <AppenderRef ref="console"/>
          <AppenderRef ref="logfile"/>
        </Root>
    </Loggers>
</Configuration>



Copyright © 2005-2024 Antenna House, Inc. All rights reserved.
Antenna House is a trademark of Antenna House, Inc.