Skip to : [Content] [Navigation]
 

How can I control logging messages printed by Pellet?

If you are using Pellet 2.0.0-rc1 or later:

Pellet uses JDK logging. The verbosity of this logging can be controlled with a configuration file. The distribution includes a sample configuration, examples/logging.properties. The location of the configuration file can be specified by setting the system property java.util.logging.config.file. The location should be specified as a (relative or absolute) path. For example, the following command would use a local file located in the current directory:

java -Djava.util.logging.config.file=my-logging.properties -jar lib\pellet-cli.jar

Note that, in the configuration file, in addition to changing the log level for specific loggers, you must change the handler’s level (you can think of it as two levels of severity checks—one at log record generation, one at consumption). You can find more information about JDK logging here.

If you are using Pellet 1.5.2 or earlier:

Pellet uses log4j for logging. The verbosity of this logging can be controlled with a log4j configuration file. The distribution includes a sample configuration, src/log4j.properties. The location of the configuration file can be specified by setting the system property log4j.configuration. The location should be specified as a (relative or absolute) URL. For example, the following command would use a local file located in the current directory:

java -Dlog4j.configuration=file:my-logging.properties -jar lib\pellet.jar

If the system property is not set, the filename defaults to log4j.properties and the corresponding file inside pellet.jar will be used. By rebuilding the jar file you can change the default configuration.

Note that jena.jar also contains a log4j.properties file that will take precedence if it precedes pellet.jar in the classpath.

There has been some sample code posted to the mailing list that might be helpful.