Logging

VODesktop is configured to report errors to the console, and a fuller log to the file ~/astro-runtime.log.

Changing Logging Behaviour

VODesktop logs messages using a library called Log4J. Log4J is very flexible - both in the quantity of messages it produces, and also the destination and format for log messages. Details of the configuration options are given on their website.

To alter the logging behaviour of VODesktop, the application must be started with a pointer to a custom logging configuration file. This file is customarily called log4j.properties. This can be done as follows:

java -Dlog4j.configuration=file:///home/user/path/to/log4j.properties -jar vodesktop-app.jar

This uses the JVM -D option to set the system property log4j.configuration. This property expects a URL which points to the logging configuration file - the example shows how to write a reference to a file.

Sample log4j.properties

The default logging configuration used by VODesktop is given below. (this can be used as a basis for custom log4j.properties files)

log4j.rootLogger=INFO, CONSOLE, FILE

log.pattern=%5p %c %m%n

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=${log.pattern}
log4j.appender.CONSOLE.threshold=WARN

log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=${log.pattern}
log4j.appender.FILE.MaxBackupIndex=1
log4j.appender.FILE.MaxFileSize=100KB
log4j.appender.FILE.threshold=INFO

log4j.appender.FILE.File=${user.home}/astro-runtime.log

#Custom rules for some parts of the system
log4j.logger.org.astrogrid.registry.client.RegistryDelegateFactory=WARN
log4j.logger.org.apache.hivemind=WARN
log4j.logger.org.apache.axis=ERROR
log4j.logger.org.astrogrid.registry.client.query=FATAL
log4j.logger.net.sf.ehcache=FATAL