Configuring Logging in the LIMPOPO MAGE-TAB Parser

LIMPOPO uses the SLF4J logging library, so you can use your own logging implementation of choice to handle logging output.

Example of Logging with Log4J

Below is an example of how you would set up logging for LIMPOPO using Log4J. This example will write all LIMPOPO logging statements of INFO level or above to a file, limpopo.log.

Create a file called log4j.xml with the following content:

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

    <appender name="console" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                   value="%d %-5p [%t] %C (%F:%L) - %m%n" />
        </layout>
    </appender>

    <appender name="limpopo" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="limpopo.log" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                   value="%d %-5p [%t] %C (%F:%L) - %m%n" />
        </layout>
    </appender>

    <logger name="uk.ac.ebi.arrayexpress2.magetab" additivity="false">
        <level value="INFO" />
        <appender-ref ref="limpopo" />
    </logger>

    <logger name="org.mged.magetab.error" additivity="false">
        <level value="INFO" />
        <appender-ref ref="limpopo" />
    </logger>

    <root>
        <priority value="INFO" />
        <appender-ref ref="console" />
    </root>

</log4j:configuration>

This setup writes log statements from limpopo or from the mged magetab error package to a file "limpopo.log", in the current working directory. Note that this is a RollingFileAppender, which Log4J uses to periodically create new files. Any other log statements are sent to the console.