-
Notifications
You must be signed in to change notification settings - Fork 11
Logging Customization
All Testbed Runtime "executables" (i.e. iWSN, RS and SNAA executable JARs) use the helper method Logging.setLoggingDefaults() from the itm-utils project to set a default Log4J Logger and PatternLayout that prints all logging statements to the console. Per default the log level is being set to INFO
. The wrapper service that ships with the assembly then takes these console logs and writes them to a log file in the logs/
subdirectory.
Depending on the startup parameters that are being passed to the executable the log level is being set to the selected level after calling Logging.setLoggingDefaults().
Depending on the executable you can either pass -v
for "verbose", or -l TRACE/DEBUG/INFO/WARN/ERROR
for setting the level explicitly. In the assembly package you can find these parameters being passed to the executable JAR in the wrapper config files tr.iwsn.conf
, tr.rs.conf
and tr.snaa.conf
in the conf/
subdirectory.
Users can override default logging behaviour by passing the parameter -Dlog4j.configuration=/path/to/my/log4j.properties
to the JVM when starting Testbed Runtime. This file is a standard log4j configuration file configuration file. This e.g. allows you to customize logging behaviour for individual classes.
The same can be achieved by placing your log4j.properties
file in the classpath. In this case it will be loaded automatically.
The assembly ships with the wrapper services of Java Service Wrapper from Tanuki Software. Many additional settings can be made in the configuration files of the wrapper conf/tr.iwsn.conf
, conf/tr.rs.conf
and conf/tr.snaa.conf
. Please see the Java Service Wrapper homepage for a comprehensive documentation.