Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ATTENTION! For new versions (fom 1.Juli, 2022) we moved to logback and the config file is found in org.slf4j.api


Remark: See below, if you are are developing with source code.

Table of Contents

If you are developing Odysseus or using the downloaded product, you can custumize the logging behavior. To enable extended logging in the downloaded product do the following:

...

Code Block
languagetext
<Root level="debug">

Remark: See official Log4j2 documentation for further informtion.

If the line is ERROR, default, change also to DEBUG, default, default2. If you now run Odysseus, after the start a new file output.log is created in your Odysseus start directory. Here, further logging information can be found. There is also the log4j2.test.xml file where you can find examples to define the logger for each feature individually.

Example for an additional file appender

If you want to add an file appender next to the console appender, you need to add an appender and an an appender reference to the log4j2.xml file as follows:

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
        <RollingFile name="RollingFile" fileName="logs/Odysseus.log" filePattern="logs/Odysseus-%d{MM-dd-yyyy}.log"
                 ignoreExceptions="false">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
            <TimeBasedTriggeringPolicy />
        </RollingFile>
    </Appenders>
    <Loggers>
        <Root level="info">
            <AppenderRef ref="Console"/>
            <AppenderRef ref="RollingFile"/>
        </Root>
   <!--      <Logger name="de.uniol.inf.is.odysseus.core" level="debug" additivity="false">
     		 <AppenderRef ref="Console"/>
    	</Logger> -->
    </Loggers>
</Configuration>

Further Error Messages

Add the following file to you working directory of Odysseus to see further error messages.

.options

Logging inside Eclipse

If you are developing with eclipse you have the following options to configure the logging.

1) In project de.uniol.inf.is.odysseus.slf4j there are some samples files for logging. If you want to change the kind of logging, you could rename one the file to log4j.xml.

Image Added

2) Another way, is to change the parameter in the product under "Launching" definition with 

-Dlog4j.configurationFile=<path to logfile>