-
Notifications
You must be signed in to change notification settings - Fork 103
Auditing Module
Nuno Oliveira edited this page Jan 14, 2016
·
37 revisions
Enter the src/ directory and launch:
mvn clean install -Pauditing
An environment variable or a Java property variable of name GEOSTORE_AUDITING_CONF must exist and point to a valid configuration file:
-DGEOSTORE_AUDITING_CONF="/opt/geostore/conf/auditing.properties"
The configuration file must contain the following properties:
auditing.enable=true
auditing.templates.directory=/opt/geostore/conf/templates
auditing.output.directory=/var/geostore/auditing
auditing.templates.version=1
auditing.max.requests.per.file=100
auditing.output.files.extension=xml
The auditing output can be configured using Apache FreeMarker template language. Three templates are required header.ftl, body.ftl and footer.ftl and should be present on the templates directory.
Follow examples of the three templates that contain all the possible values.
<?xml version="1.0" encoding="UTF-8" ?>
<Requests>
<#escape x as x?xml>
<Request id="${id!""}">
<HttpMethod>${httpMethod!""}</HttpMethod>
<Path>${path!""}</Path>
<BasePath>${basePath!""}</BasePath>
<QueryString>${queryString!""}</QueryString>
<RemoteAddr>${remoteAddr!""}</RemoteAddr>
<RemoteHost>${remoteHost!""}</RemoteHost>
<RemoteUser>${remoteUser!""}</RemoteUser>
<UserName>${userName!""}</UserName>
<UserRole>${userRole!""}</UserRole>
<UserGroups>${userGroups!""}</UserGroups>
<Host>${host}</Host>
<#if bodyAsString??>
<Body>${bodyAsString}</Body>
</#if>
<#if failed??>
<Failed>true</Failed>
<ErrorMessage>${errorMessage!""}</ErrorMessage>
<#else>
<Failed>false</Failed>
</#if>
<ResponseStatus>${responseStatus!""}</ResponseStatus>
<ResponseContentType>${responseContentType!""}</ResponseContentType>
<ResponseLength>${responseLength!""}</ResponseLength>
<StartTime>${(startTime?number?number_to_datetime?iso_utc_ms)!""}</StartTime>
<EndTime>${(endTime?number?number_to_datetime?iso_utc_ms)!""}</EndTime>
<TotalTime>${totalTime!""}</TotalTime>
</Request>
</#escape>
</Requests>