T
- builder typepublic interface EventBuilder<T extends EventBuilder<T>>
AuditableEvent
instances. The mandatory typeId is expected to be initiated by constructing the
builder.
Warning: The text message
and object
parameters
may provide more details about the event, but Hazelcast doesn't guarantee their content (e.g. exact text value of
the message, parameter names, object types used in parameters). They can change between versions.
AuditlogService.eventBuilder(String)
Modifier and Type | Method and Description |
---|---|
T |
addParameter(String key,
Object value)
Adds single event parameter to the parameters Map.
|
AuditableEvent |
build()
Builds the
AuditableEvent instance. |
T |
cause(Throwable throwable)
Sets error/exception which caused the event (if any).
|
T |
level(Level level)
Sets the event
Level . |
void |
log()
Builds the event and logs it to the service which provided this builder (if any).
|
T |
message(String message) |
T |
parameters(Map<String,Object> parameters) |
T |
timestamp(long timestamp)
If provided value greater than zero, then it sets the event timestamp explicitly.
|
T message(String message)
message
- event message. May be null
T parameters(Map<String,Object> parameters)
parameters
- event parameters. Must not be null
T addParameter(String key, Object value)
key
- Must not be null
value
- T level(Level level)
Level
. The default value is Level.INFO
.level
- T cause(Throwable throwable)
throwable
- T timestamp(long timestamp)
build()
method.throwable
- AuditableEvent build()
AuditableEvent
instance. If the timestamp is not configured explicitly, then the call sets event
timestamp too.null
event instance ready to be loggedvoid log()
AuditlogService.eventBuilder(String)
Copyright © 2022 Hazelcast, Inc.. All rights reserved.