-
Notifications
You must be signed in to change notification settings - Fork 4
Logging Guide
For the creation of logs, we are using the Spring AOP. There is a Aspect Component created as upb.ida.logging.AspectLogger which has multiple pointcuts and logging methods. In our case, we are using the following methods of AOP:
- @Before (When a particular method is called)
- @AfterReturning (When a particular method finishes and it returns something)
- @AfterThrowing(When an exception occurs in a particular method)
At the moment, the logging has been done for the following type of methods:
- Logging the Request to the controller methods of Message Rest Controller (as in upb.ida.rest.MessageRestController).
- Logging the Response by the controller methods of Message Rest Controller (as in upb.ida.rest.MessageRestController).
- Logging of Exceptions thrown by any of the methods of Ida. (as in upb.ida..*..).
The logs are saved in the format of an appended message which contains concrete details about the request, response or an exception. For Example, the request to the message rest controller is logged as:
INFO 2018-11-23 14:59:19,942 [http-nio-8080-exec-1] upb.ida.logging.AspectLogger - Request - 0:0:0:0:0:0:0:1 upb.ida.rest.MessageRestController.sendmessage(I would like you to load the city dataset,0,,)
- LogLevel (INFO, TRACE or ERROR)
- Timestamp
- Tomcat Server and Port
- LoggerClass callee.
- Type of Logging (request, Response, Exception)
- IpAdress of Request Sender
- LogMessage (which contains the class name, class args, return bean and exception in respective cases.)
The logs can be found in the folder:
/ida/ida-ws/
And the log files are:
- ida-ws-dataset-response.log
- ida-ws-exceptions.log
- ida-ws-requests_responses.log
The configurations can be updated in the log4j.properties file and the configuration file can be found in the folder /ida/ida-ws/.
Developer Guide