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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?