Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Creating a pluggable audit logger

Mark Prins edited this page Apr 13, 2019 · 1 revision

Pluggable audit providers are discovered using the Java SPI (Service Provider Interface) functionality. To create a pluggable audit provider you need to:

  1. implement the nl.b3p.viewer.audit.LoggingService interface:
public final class NOPLoggingService implements LoggingService {

    @Override
    public void logMessage(String user, String message) {
    }
}
  1. add a SPI file named nl.b3p.viewer.audit.LoggingService that lists the classname of your implementation in the META-INF/services directory of your jar file.
nl.b3p.viewer.audit.impl.NOPLoggingService

SPI file META-INF/services/nl.b3p.viewer.audit.LoggingService

In your deployment you should add the created jar file in the WEb-INF/lib directory of the viewer webapp.

A working example is available in the viewer-audit-noplogger module.

Clone this wiki locally