PSL uses SLF4J for logging.


In the PSL Java interface, SLF4J is bound to Log4j 1.2. The Log4j configuration file is located at src/main/resources/log4j.properties. It should look something like this:

# Set root logger level to the designated level and its only appender to A1.
log4j.rootLogger=INFO, A1

# A1 is set to be a ConsoleAppender.

# A1 uses PatternLayout.
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

# Change our connection pool to only log errors.
# Since we may set our root logger to something more loose, we want to explicitly set this.

The logging verbosity can be set by changing ERROR in the second line to a different level and recompiling. Options include OFF, WARN, DEBUG, and TRACE.


In the command line interface, the logging level can be set using the same logging levels like this:

java -jar psl.jar --infer --data example.data --model example.psl -D log4j.threshold=DEBUG
Edit This Page