@StableMinor(version="12.4", sinceVersion="12.3") public interface IAccessAuditLogger
ManagerFactory
.getAccessAuditLogger()
// the performed action (if any)
.action("render")
// here some area to indicate where the access happened
.area("User List")
// some category may be adder if needed
.category("Some category")
// if the accessed user identifier is known (or if other identification is desired to be used as the user identifier, such as
// an email, for example), it should be added with this method
.accessedUserId("XXXXXX")
// if the current user identifier is known (or if other identification is desired to be used as the user identifier, such as
// an email, for example), it should be added with this method
// by default, if no user is set with this method, the currently monitored user will try to be added
.currentUserId("YYYYYY")
// if it is known that the access was originated by some specific URL, it should br
// added in log entry using this method.
// if the code adding the log message is in the context of a LumisXP request,
// the URL will be added automatically (but still can be replaced by calling this method)
.url("https://some_domain/some/path/")
// if other parameters are desired to be logged as well, they should be added
// with this method (the values and keys of the map will replace line endings with a space character)
.extraParameters(Map.of("some extra parameter", "the parameter value"))
// write the log message.
// if the "log" method is not called, the log entry will not be recorded.
// if no log message is desired, .log() could have been used instead
.log("Rendered some user information here");
2020-02-10 16:24:07,731 IP: [172.18.0.1] LOGIN: [yoda] URL: [https://some_domain/some/path/] AREA: [User List] CATEGORY: [Some category] ACTION: [render] CURRENT_USER_ID: [YYYYYY] ACCESSED_USER_ID: [XXXXXX] EXTRA_PARAMS: [{some extra parameter: the parameter value}] THREAD: [Thread name goes here] MESSAGE: Rendered some user information here
lumisservice
lumisservice.lumis
lumisservice.lumis.util
lumisservice.lumis.util.log
lumisservice.lumis.util.log.AccessAuditLogger
lumisservice.lumis.util.log.AccessAuditLogger
category for the AccessAuditLoggerAppender
appender. This appender, in the default log configuration, writes the messages to a file ${lumisdata}/log/lumis/accessaudit/accessaudit.log
and
is configured to roll the file every day at midnight without removing old files.Modifier and Type | Method and Description |
---|---|
IAccessAuditLogger |
accessedUserId(String accessedUserId)
Sets the accessed user identifier (if any).
|
IAccessAuditLogger |
action(String action)
Sets the action performed when the access was generated (if any).
|
IAccessAuditLogger |
area(String area)
Sets the area from where the access was generated from (if any).
|
IAccessAuditLogger |
category(String category)
Sets the category from where the access was generated from (if any).
|
IAccessAuditLogger |
currentUserId(String currentUserId)
Sets the current user identifier (if any).
|
IAccessAuditLogger |
extraParameters(Map<String,String> extraParameters)
Sets any desired extra parameters to be logged.
|
void |
log()
Log an access audit entry with no message.
|
void |
log(String message)
Log an access audit entry with the given message.
|
IAccessAuditLogger |
url(String url)
Sets the URL that generated the access.
|
IAccessAuditLogger url(String url)
url
- the accessed URL that generated the access.IAccessAuditLogger area(String area)
area
- the area.IAccessAuditLogger category(String category)
category
- the category.IAccessAuditLogger action(String action)
action
- the action.IAccessAuditLogger accessedUserId(String accessedUserId)
accessedUserId
- the accessed user identifier.IAccessAuditLogger currentUserId(String currentUserId)
currentUserId
- the current user identifier.IAccessAuditLogger extraParameters(Map<String,String> extraParameters)
extraParameters
- the extra parameters.void log()
void log(String message)
message
- the message.LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.