Class AccessLogService

java.lang.Object
fr.paris.lutece.portal.service.security.AccessLogService

@ApplicationScoped public class AccessLogService extends Object
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 Details

  • Method Details

    • getInstance

      @Deprecated(since="8.0", forRemoval=true) public static AccessLogService getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use @Inject to obtain the AccessLogService instance. This method will be removed in future versions.
      Returns the unique instance of the AccessLogService service.

      This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with @Inject to obtain the AccessLogService instance 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 type
      strAppEventCode - the event code
      connectedUser - the user connected
      data - the message object to log
      specificOrigin - 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 type
      strAppEventCode - the event code
      connectedUser - the user connected
      data - 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

      public void onControllerInvocation(@Observes BeforeControllerEvent event)
      Observes all controller invocations and logs access according to context.
      Parameters:
      event - the controller invocation event