Logging error from your customization
Now that we have refactored our code to allow dependency injection, we can implement a custom login library to log details using a mechanism different from the Dynamics 365 ITracingService
interface.
In this recipe, we will implement a custom logging library that logs to both the Dynamics 365 ITracingService
interface as well as a CRM entity, which in turn writes to an Azure Service Bus.
Getting ready
Since we are building on top of an already layered code, we will be reusing the refactored plugin from the first recipe in this chapter, Refactoring your plugin using a three-layer pattern. Alternatively, you can start from scratch. If you are building your own plugin, follow the steps from the first recipe to mimic a structure similar to ours.
From an Azure perspective, you will need an existing Azure Service Bus queue, as described in Chapter 5, External Integration, Setting up an Azure Service Bus endpoint. You will need the plugin registration tool to set...