Berlioz provide several logging options.

Logging API

Berlioz uses SLF4J as a logging API, so the Java code is implemented against that:

To create a logger, you can declare a static variable in the generator

private final static Logger LOGGER = LoggerFactory.getLogger(MyGenerator.class);

Messages can then be logged with:

LOGGER.debug("something happened");
LOGGER.info("something happened...");
LOGGER.warn("something happened!!!");
LOGGER.info("{} happened", "Something");

See the API documentation for SLF4J for details:

Logging Configuration


The logging framework (implementation) we recommend is Logback:

At startup, Berlioz will automatically pick up the logging configuration from the config folder (/WEB-INF/config) as logback-[mode].xml

This is where you can configure your log and define where you want them to go. Typically, it is preconfigured to go to jetty/logs/[webappname] as .log files and rollover daily in production.

You can configure it to send it to a location of your choice or change the threshold level for particular packages if you need finer control.

See the manual for details:


Alternatively, Berlioz can be configured to work with Apache Log4J 1.2. Simply put the log4j-[config].xml in the config folder.

Other frameworks

Berlioz can also be configured to work with other logging frameworks, but the configuration must be done independently.

Berlioz admin

The Berlioz admin tools should be able to locate the log files from the configuration and display them. When using Logback, they will also capture the most recent log messages and display them online regardless of the logging configuration.

Sample Logback configurations

Development mode

In development (or dev) mode, it is often useful to have a fine control of where the messages come from and have them send to Beagle or the console. Here is an example:

<configuration debug="false" scan="true" scanPeriod="30 seconds">
  <!-- Sends logs to Logback's Beagle Eclipse plugin -->
  <consolePlugin />

  <!-- Console appender -->
  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <pattern>[%thread] %-5level %logger{30} - %msg %n</pattern>

  <!-- Some libraries can be chatty... -->
  <logger name="net.sf.ehcache"       level="INFO" />
  <logger name="org.pageseeder.flint" level="WARN" />

  <!-- Berlioz and Bastille -->
  <logger name="org.pageseeder.berlioz" level="WARN" />
  <logger name="org.pageseeder.bastille" level="WARN" />
  <logger name="org.pageseeder.bastille.flint" level="WARN" />
  <logger name="org.pageseeder.bastille.cache" level="INFO" />
  <logger name="org.pageseeder.bastille.recaptcha" level="DEBUG" />

  <root level="DEBUG">
    <appender-ref ref="STDOUT"/>


In production, it is often preferable to have messages recorded on files:

<configuration debug="false">

  <!-- General Logs (text) -->
  <appender name="GENERAL" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- rollover daily -->
      <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
        <!-- or whenever the file size reaches 100MB -->

  <root level="INFO">
    <appender-ref ref="GENERAL"/>


The Berlioz admin tools should automatically capture the most recent logs events regardless of the configuration.

Created on , last edited on