Skip to end of metadata
Go to start of metadata

The log functionality of the Servoy Application Server is based on log4j of the |Apache Logging Services|http://logging.apache.org/] project.

The logging mechanism is highly configurable and enables control over:

  • the level of logging per area
  • the format of the log file
  • log file rollover/location/size settings

All log settings are stored in servoy.properties located in the /application_server directory. The specific log properties are properties prefixed with 'log4j'.

Changing the log level

There are 6 levels of logging (In order of severity):

  1. FATAL: The FATAL level designates very severe error events that will presumably lead the application to abort.
  2. ERROR: The ERROR level designates error events that might still allow the application to continue running.
  3. WARN: The WARN level designates potentially harmful situations.
  4. INFO: The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
  5. DEBUG: The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
  6. TRACE: The TRACE Level designates finer-grained informational events than the DEBUG.

By default, the log level is set to WARN. This means that all WARN, ERROR and FATAL messages will be logged. In the servoy.properties file, there are three entries:

Leglevel settings in servoy.properties
log4j.logger.com.servoy.j2db.util.Debug=WARN
log4j.logger.org.apache.wicket=WARN
log4j.rootCategory=WARN, file, configservlet

The first entry sets the log level for the internal Servoy Java class used for all logging done by Servoy.
The second entry sets the log level for the Java class used for all logging of the Wicket framework, used for the Servoy Web Client
The third entry sets the overall log level and specifies the output channels for the log.

To change the the log level for Servoy, replace 'WARN' in the first entry with, for example 'TRACE' to get the most logging information. The overall log level could also be set, but this would generate a lot of log data.

Servoy registers the following loggers:

  • com.servoy.j2db.util.Debug
  • com.servoy.j2db.persistence.Server
  • com.servoy.j2db.dataprocessing.ClientManager
  • com.servoy.j2db.terracotta.TerracottaStatusMonitor
  • com.servoy.j2db.persistence.XMLExporter
  • com.servoy.j2db.persistence.XMLImportHandlerVersions1to10
  • com.servoy.j2db.persistence.XMLInMemoryImportHandlerVersions11AndHigher
  • com.servoy.j2db.server.WebServer
  • com.servoy.j2db.persistence.datasource.TransactionConnection
  • com.servoy.extensions.plugins.rest_ws.RestWSPlugin (when plugin is available).

The logging level can be set independently for all these loggers, by adding extra 'log4j.logger' entries in the servoy.properties file, like:

Set the loglevel to the most finegrained level for the ClientManager class
log4j.logger.com.servoy.j2db.dataprocessing.ClientManager=TRACE

Setting the log level to DEBUG or TRACE will generate a lot of logging data. This is not recommended in a production environment, unless absolutely necessary. Make sure enough disk space is available.

More information on Log4J

For more information on log4j, visit http://logging.apache.org/log4j/ or visit the Frequently Asked Technical Questions section