Child pages
  • Server Log Settings
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

The log functionality of the Servoy Application Server is based on log4j of the Apache Logging Services 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:

  • before Servoy 8.4: servoy.properties located in the <servoy>/application_server directory. The specific log properties are properties prefixed with 'log4j'.
  • Servoy 8.4 and later: all log settings are in a separate file: log4j.xml located in the <servoy>/application_server

In case of WAR deployment, the export as war wizard will allow you to specify the log4j.xml/servoy.properties that you want the war deployment to use.

Besides the log4j properties, administrators can also configure the servoy.client.report.max.valuelist.items property on the Servoy admin page, or directly in the servoy.properties file. This property is used to disable/enable the logging of messages that not all records can be loaded into the valuelist, i.e. when the valuelist contains more than 500 records. It is not recommended to set this property to false when running from the Servoy developer, otherwise the developers will not be aware of these warnings at all.

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. Some entries we have there:

Some log level settings from servoy.properties (< 8.4)
log4j.logger.com.servoy.j2db.util.Debug=WARN
log4j.logger.org.apache.wicket=WARN
log4j.logger.com.org.sablo.websocket=WARN
log4j.rootCategory=WARN, file, configservlet
Some log level settings from log4j.xml (>= 8.4))
    <Loggers>
        <Logger name="com.servoy.j2db.util.Debug" level="WARN" />
        <Logger name="org.apache.wicket" level="WARN" />
        <Logger name="org.sablo.websocket" level="WARN" />
        <Root level="WARN">
            <AppenderRef ref="asyncfile" />
            <AppenderRef ref="configservlet" />
            <AppenderRef ref="debugconsole" />
            <!-- <AppenderRef ref="stdout" /> -->
        </Root>
    </Loggers>


The first entry sets the log level for the internal Servoy Java class used for most of the application server level 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.

See an example of a log entry, the pattern is defined in PatternLayout:

Log entry
2019-03-25 10:48:52,965 ERROR [Executor,uuid:3f0bccdb-0dec-42fd-8c06-81b67fad3bce] com.servoy.j2db.util.Debug - error getting data from global method valuelist 

It starts with date, log level (Error in this case), thread that logged this error, logger name then message. In this case, this message is logged under: com.servoy.j2db.util.Debug logger. So, in order to hide/show/customize this message you have to use that logger name in log4j.xml .

Servoy registers the following loggers:

  • com.servoy.j2db.util.Debug
  • 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
  • datasource.TransactionConnection
  • com.servoy.automation.jsunit.runner.ImportClient
  • com.servoy.automation.jsunit.SolutionJSTestSuite
  • com.servoy.j2db.server.ngclient.MessageLogger
  • ResourceProvider
  • com.servoy.less.Compiler
  • org.sablo.BrowserConsole
  • WebsocketSessionManager (and other different sablo classes)
  • 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 log4j.xml 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

  • No labels