Audit Logging

The history mode logs all requests into a database. This can put a very significant strain on the database and can lead to insertion issues as the request table begins to host millions of records.

As an alternative to the history mode it’s possible to enable the auditing logger, which will log the details of each request in a file, which is periodically rolled. Secondary applications can then process these log files and built ad-hoc summaries off line.


The file can contain the following items to enable and configure file auditing:


The audit.enable is used to turn on the logger (it is off by default). The audit.path is the directory where the log files will be created. The audit.roll_limit is the number of requests logged into a file before rolling happens. The files are also automatically rolled at the beginning of each day.

In clustered installations with a shared data directory the audit path will need to be different for each node. In this case it’s possible to specify the audit path by using a JVM system variable, add the following to the JVM startup options and it will override whatever is specified in


Log Files

The log directory will contain a number of log files following the geoserver_audit_yyyymmdd_nn.log pattern. The nn is increased at each roll of the file. The contents of the log directory will look like:


By default each log file contents will be a xml document looking like the following:

<?xml version="1.0" encoding="UTF-8" ?>
        <Request id="168">

Customizing Log Contents

The log contents are driven by three FreeMarker templates.

header.ftl is used once when a new log file is created to form the first few lines of the file. The default header template is:

<?xml version="1.0" encoding="UTF-8" ?>

content.ftl is used to write out the request details. The default template dumps all the known fields about the request:

<#escape x as x?xml>
<Request id="${id!""}">
   <#if bodyAsString??>
   <#if error??>

footer.ftl is executed just once when the log file is closed to build the last few lines of the file. The default footer template is:


The administrator is free to provide alternate templates, they can be placed in the same directory as, with the same names as above. GeoServer will pick them up automatically.