Adeptia Connect logs several types of messages during the execution of a service, for example, a Process Flow, to help you monitor and troubleshoot the application. Message logging is done at four levels: ERROR, NOTICE, INFO, and DEBUG. The NOTICE log level captures the error messages in the production environment, for example, an error message related to the Queue Processor.
There are two types of logging that Adeptia Connect supports:
Synchronous logging
In Synchronous logging, the application logs the messages as and when there is one to be logged and execution of the service is put on hold until the complete message is written in the log. For example, If there are three error messages generated during a Process Flow execution, the execution proceeds to the next stage only after these three error messages are logged. The same execution thread is used for logging also which leads to a stalled execution of the service for the time while the messages are being logged.
Asynchronous logging
In Asynchronous logging, the logging happens in a thread that is separate from the service execution thread. This leads to an uninterrupted execution of the service as it does not need to wait for the logging to be completed. An effective logging mechanism depends on two key factors, low latency, and maximum throughput.
- Latency: Time taken for performing the action and producing the result.
- Throughput: The number of actions executed per unit of time.
Benefits and constraints of Asynchronous logging
Asynchronous logging benefits a user in terms of achieving lower latency and maximum throughput.
- Maximum throughput: With an asynchronous logger, the application can log messages at 6 - 68 times the rate of a synchronous logger.
- Lower latency: As the logging occurs in a separate thread, it significantly lowers the latency to the minimum in the overall execution of the service.
Although asynchronous logging can give significant performance benefits, it has the following limitations to take into account:
- In case of an abrupt shutdown, the log messages may get lost. Adeptia Connect implements a shutdown hook to ensure that all logs in the queue are logged before bringing the application down.
- In case of a vast number of messages to be logged, the log may display the messages with a delay and after the execution of the service.
Logging configuration
Logging parameters are pre-configured in the application. However, if you want to update the configuration parameters you can follow the steps below to navigate to the Asynchronous logging properties window:
- Click Configure > Developer Studio.
- Click Proceed.
- On the Connect Server home page, click Administer tab.
- Go to Setup menu and select the Application Settings option.
- Click Update System Properties.
Navigate to Systems > Asynchronous Logging.
Setting the abpm.log4j.async.logging.enable property to false changes the logging to be in Synchronous mode. You can also update the rest of the listed properties based on your requirements.