May 24, 2024 2:52:07 PM seb leridon avatar

Access logger

Introduction

Access Log service implementation

  • 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.
  • This service implements the interface IAccessLogger of lutece core, and is used by the service AccessLogService of Lutece core.

Configuration

Use "debug" or "trace" level for fine access control

Use "info" level otherwise

By default, Lutece authentication, user and rights management are logged at info level, and all actions and views calls are logged at trace level.

A specific log format can be set in the properties file :

portal.defaultAccessLogger.messageFormat
portal.defaultAccessLogger.messageFormatSeparator

Log lines could be certified with a hash, that could be verified, whith this property set to true :

portal.defaultAccessLogger.addHashToLogs

Usage

To log specific actions, use :

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 :

  • AccessLoggerConstants.EVENT_TYPE_READ
  • AccessLoggerConstants.EVENT_TYPE_CREATE
  • AccessLoggerConstants.EVENT_TYPE_DELETE
  • AccessLoggerConstants.EVENT_TYPE_MODIFY
  • AccessLoggerConstants.EVENT_TYPE_CONNECT
  • AccessLoggerConstants.EVENT_TYPE_DISCONNECT
  • AccessLoggerConstants.EVENT_TYPE_RIGHTS