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 troubleshoot the application. Message logging is done at three levels: ERROR ERROR, INFO, and NOTICE. The NOTICE log level captures the error messages in the production environment, for example, an error message related to Queue Processor.
There are two types of logging that Adeptia Connect supports:
- Synchronous logging
- Asynchronous logging
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 logger. For example, If there are three error messages generated during a Process Flow execution, the Process Flow resumes 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 which is separate from the service execution thread. This leads to an uninterrupted execution of the service and 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. A holistic and effective logging depends upon two factors, latency and throughput:
- Latency: Time required to perform some action or to produce some result. Time of a transaction, or service invocation.
- Throughput: The number of some actions executed or results produced per unit of time.
Info |
---|
Adeptia Connect recommends that you use asynchronous logging to substantially improve the throughput and lower the latency of logging operation. |
Benefits and constraints of
...
Asynchronous logging
The chart below shows the performance difference between synchronous and asynchronous logging, and how much latency increased as more concurrent messages were added. In this test, an app logged about one million messages, using an increasingly higher amount of threads on each run. Each transaction resulted in 1000 messages.
As indicated by the chart, the results of logging asynchronously are significantly closer to the results of not logging at all.
Aman:
•Higher peak 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 overall execution of the service.
Although asynchronous logging can give significant performance benefits, there are situations where you may want to choose synchronous logging. This section describes some of the trade-offs of asynchronous logging.
Benefits
- Higher throughput. With an asynchronous logger your application can log messages at 6 - 68 times the rate of a synchronous logger.
- Lower logging latency. Latency is the time it takes for a call to Logger.log to return. Asynchronous Loggers have consistently lower latency than synchronous loggers or even queue-based asynchronous appenders. Applications interested in low latency often care not only about average latency, but also about worst-case latency. Our performance comparison shows that Asynchronous Loggers also do better when comparing the maximum latency of 99% or even 99.99% of observations with other logging methods.
- Prevent or dampen latency spikes during bursts of events. If the queue size is configured large enough to handle spikes, asynchronous logging will help prevent your application from falling behind (as much) during sudden bursts of activity.
What is Logging (In general)
Types of Logging supported in Adeptia Connect
Explain Synchronous logging and Asynchronous logging (use graphics to explain as mulesoft) :
- Latency: Time required to perform some action or to produce some result. Time of a transaction, or service invocation.
- Throughput: The number of some actions executed or results produced per unit of time.
Benefits using Asynchronous logging (explain using chart)
Performance tests chart
Limitations of Asynchronous logging
View the Runtime Log in Adeptia Connect
Log Level
Exception Handling with Asynchronous Logging
Shutdown hook
Configuring the Logging it has the following limitations to take into account:
- In case of abrupt shutdown, the log messages may get lost. Adeptia Connect implements a shutdown hook to ensure that all logs in the queue are actually logged before bringing the application down.
- In case of high number of messages to be logged, the log may display the messages with a delay and after the execution of the service.