Reliable Logging with Azure Service Bus and Logging-As-A-Service
    • Dark
      Light
    • PDF

    Reliable Logging with Azure Service Bus and Logging-As-A-Service

    • Dark
      Light
    • PDF

    Article Summary

    #ServerlessTips - Azure Service Bus
    Author: Mandar Dharmadhikiri Business & Integration Architecture Manager

    Logging milestones in the end-to-end journey of a transaction is of paramount importance when achieving true observability of business systems. frameworks like Log4Net, NLog, Serilog allow developers to write to different sinks using a standardized logging API provided by the framework.

    This API invocation-based logging process is not completely fail-proof. The logging API might itself sometimes throw exceptions, suffer scalability issues, etc. In such cases, it is possible to lose critical messages, which makes debugging issues a problem. While simple enterprise applications might be okay with the loss of the messages, this loss has a pronounced effect when financial transactions are volved or mission critical embedded systems are involved. In such cases, reliable logging can be achieved by creating a message consumption-based logging as a service. One such architecture is shown below.
    Reliable Logging with Azure Service Bus and Logging-As-A-Service

    1. The application code pushes messages on to service bus queue
    2. An azure function subscribes to the messages and writes to multiple stores to introduce additional redundancy.
    3. In case of any exceptions, the logging API deadletters the message(after retry) as well as send a notification to a ops-management systems where the system administrators can act it.

    This system is over engineered and can increase cost and latency in processing logging events, but provides reliability through the safe delivery of message through service bus and multi store redundancy logging and exceptional handling at the logging API level itself.

    Thus a careful evaluation of business needs is required before opting for this pattern.

    MicrosoftTeams-image 491


    Was this article helpful?