Create the installer class
After you create the trace listener constructor class, you implement the installer class.
The installer class executes logic on the application start. To create the installer class:
- In Visual Studio, open the context menu of the ExternalLogging project and click Add » Class
- Name the class file Installer.cs and click Add.
- Open the Installer.cs file and add method
In the code of the method, you subscribe to the Log.Configuring event which is raised before the start of the Sitefinity CMS logging configuration.
- Add the
Configuring event handler.
In this code section, you resolve the default configurator. Next, you create an instance of the
RaygunConfigurator that that you previously created. Finally, you register the
RaygunConfigurator instance using
GITHUB EXAMPLE: For more information about the content of the file, see the Installer.cs file of the downloaded sample project.
- Add the AssemblyInfo.cs class, which must be located in the Properties folder of the ExternalLogging project.
In the code of the class, the PreApplicationStart method in the Installer class is called by ASP.NET on application start of any Sitefinity CMS project.
GITHUB EXAMPLE: For more information about the content of the file, see the AssemblyInfo.cs file of the downloaded sample project.
Finally, you need to reference the ExternalLogging class library, in your Sitefinity CMS application.