Mar 6, 2018 5:25:39 PM seb leridon avatar   722

Lutece's logs

Lut├Ęce has several log files:

  • application.log contains the main events the application: loading services, plugins, etc.
  • error.log contains all the abnormal facts.

Exception handling


Any exception must be logged in a log file.

The catchne blocks must never be empty or call e.printStackTrace ()

Uncritical exceptions

Exceptions that do not require stopping the current process should be logged as follows

catch (Exception e)
{
     AppLogService.error (e.getMessage (), e);
}

Critical Exceptions

Exceptions requiring stopping processing (examples: SQL error, problem file access, ...) must throw an exception derived from LuteceException ( PhysicalException , ClientException ...). The LuteceException class itself writes the logs. The treatment of the catch block will then be realized in the following way:

catch (Exception e)
{
     throw new AppException (e.getMessage (), e);
}

Application Exceptions

Application exceptions, such as UserActionException , are the only ones that do not need to be logged because they correspond to a normal case of execution of the application.