Class AccessLogService
java.lang.Object
fr.paris.lutece.portal.service.security.AccessLogService
Access Log service
- Report all actions regarding authentication, user or rights management. - All messages should contain the application Id, the event type, a specific
application event code, the logged user, and specific contextual data. - The logger should implement the interface IAccessLogger of lutece core
Use "debug" or "trace" level for fine access control history, use "info" level otherwise
By default : - Lutece authentication, user and rights management are logged at INFO level, - action requests at DEBUG level, - views requests are logged at
TRACE level.
To log specific actions, use :
AccessLogService.getInstance( ).warn( String strEventType, String strAppEventCode, String strConnectedUserLogin, Object data ); AccessLogService.getInstance(
).info( String strEventType, String strAppEventCode, String strConnectedUserLogin, Object data ); AccessLogService.getInstance( ).debug( String strEventType,
String strAppEventCode, String strConnectedUserLogin, Object data ); AccessLogService.getInstance( ).trace( String strEventType, String strAppEventCode,
String strConnectedUserLogin, Object data );
Event types are available in AccessLoggerConstants class.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddebug(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with Debug levelvoiddebug(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with Debug levelstatic AccessLogServiceDeprecated, for removal: This API element is subject to removal in a future version.voidinfo(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with info levelvoidinfo(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with info levelvoidObserves all controller invocations and logs access according to context.voidtrace(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with trace levelvoidtrace(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with trace levelvoidwarn(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with warn levelvoidwarn(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with warn level
-
Field Details
-
ACCESS_LOG_FO
- See Also:
-
ACCESS_LOG_BO
- See Also:
-
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theAccessLogServiceinstance. This method will be removed in future versions.Returns the unique instance of theAccessLogServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theAccessLogServiceinstance instead.- Returns:
- The unique instance of
AccessLogService.
-
info
public void info(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with info level- Parameters:
strEventType- the event typestrAppEventCode- the event codeconnectedUser- the user connecteddata- the message object to logspecificOrigin- specific origin of the event to log
-
info
public void info(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with info level- Parameters:
strEventType- the event typestrAppEventCode- the event codeconnectedUser- the user connecteddata- the message object to log
-
debug
public void debug(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with Debug level- Parameters:
strEventType-strAppEventCode-connectedUser-data-specificOrigin-
-
debug
public void debug(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with Debug level- Parameters:
strEventType-strAppEventCode-connectedUser-data-
-
trace
public void trace(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with trace level- Parameters:
strEventType-strAppEventCode-connectedUser-data-specificOrigin-
-
trace
public void trace(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with trace level- Parameters:
strEventType-strAppEventCode-connectedUser-data-
-
warn
public void warn(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data, String specificOrigin) Log action with warn level- Parameters:
strEventType-strAppEventCode-connectedUser-data-specificOrigin-
-
warn
public void warn(String strEventType, String strAppEventCode, fr.paris.lutece.api.user.User connectedUser, Object data) Log action with warn level- Parameters:
strEventType-strAppEventCode-connectedUser-data-
-
onControllerInvocation
Observes all controller invocations and logs access according to context.- Parameters:
event- the controller invocation event
-
@Injectto obtain theAccessLogServiceinstance.