Logging

Adeptia Connect logs messages in console as well as in the log database 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 all the notable events in the application including the error messages. For example, Adeptia Connect logs startup message for the microservices when they start.

Adeptia recommends that you set the log level to NOTICE for logging messages.

Asynchronous logging

By default, Asynchronous logging is enabled in Adeptia Connect. 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.

Asynchronous logging substantially improves the throughput and lowers the latency in the overall execution of a service.

The following sections describe the benefits and constraintsformat of log messageslogging properties.

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, it can log messages at a higher rate in comparison to 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 which is a rare scenario, the log messages are lost if they are present in the Asynchronous queue and have not been already logged.

    In case of graceful shutdown, 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 or after the execution of the service.

Format of log messages

The actual message in the log is accompanied by several other useful information. All the information in the logs is stored in key-value pair format. Storing the information in key-value pair format in the logs has its advantage – the mapped key-value pattern proves to be useful as it tells you what is the meaning of each field that is being printed on the console and the log database.

The following example gives you an idea about the log message format:

2020-03-17 12:52:48,785 INFO [Adeptia Connect 3.2 Kernel Thread] system com.adeptia.indigo.event.QuartzEventFactory.activateAutoCleanupService(QuartzEventFactory.java:636)

- category="initializeEvent" groupId="administrators" message="DEFAULT.autoCleanup will run at: Sat May 23 03:00:00 UTC 2020" nodeName="10.0.0.72" userId="admin"

Logging properties

Logging properties are pre-configured for Adeptia Connect microservices. However, you can configure them based on your requirement. For a complete list of logging properties related to different microservices, refer to the application properties page.