Package org.wildfly.security.audit
Class FileAuditEndpoint
- java.lang.Object
-
- org.wildfly.security.audit.FileAuditEndpoint
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>,AuditEndpoint
- Direct Known Subclasses:
PeriodicRotatingFileAuditEndpoint,SizeRotatingFileAuditEndpoint
public class FileAuditEndpoint extends Object implements AuditEndpoint
An audit endpoint to record all audit events to a local file.- Author:
- Darran Lofthouse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileAuditEndpoint.BuilderA builder for file audit endpoints.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(EventPriority priority, String message)Accept formatted security event message to be processed written into target local file.static FileAuditEndpoint.Builderbuilder()Obtain a newFileAuditEndpoint.Buildercapable of building aFileAuditEndpoint.voidclose()Close the endpoint and stop handling further events immediately.
-
-
-
Field Detail
-
clock
protected final Clock clock
Clock providing access to current time.
-
-
Method Detail
-
accept
public void accept(EventPriority priority, String message) throws IOException
Accept formatted security event message to be processed written into target local file.- Specified by:
acceptin interfaceorg.wildfly.common.function.ExceptionBiConsumer<EventPriority,String,IOException>- Parameters:
priority- priority of the logged messagemessage- the logged message- Throws:
IOException- when writing into the target local file fails
-
close
public void close() throws IOExceptionDescription copied from interface:AuditEndpointClose the endpoint and stop handling further events immediately.- Specified by:
closein interfaceAuditEndpoint- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- if an error occurs closing the endpoint.
-
builder
public static FileAuditEndpoint.Builder builder()
Obtain a newFileAuditEndpoint.Buildercapable of building aFileAuditEndpoint.- Returns:
- a new
FileAuditEndpoint.Buildercapable of building aFileAuditEndpoint.
-
-