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:

  1. In Visual Studio, open the context menu of the ExternalLogging project and click Add » Class
  2. Name the class file Installer.cs and click Add.
  3. Open the Installer.cs file and add method PreApplicationStart.
    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.
  4. 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 ObjectFactory.Container.RegisterInstance<ISitefinityLogCategoryConfigurator>(customConfigurator);

    GITHUB EXAMPLE: For more information about the content of the file, see the Installer.cs file of the downloaded sample project.

  5. 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.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?