Initializing hooks to subscribe events to prepare an audit trail

Sitecore hooks provide you with an interface to invoke custom logic on system initialization before any HTTP web request is served. You can use hooks to subscribe to events dynamically, configure memory and health monitoring, switch MediaProviders and LinkProviders, interpret URLs, and much more.

In this recipe, you will learn how to use hooks to subscribe events to prepare an audit trail of different item operations such as create, delete, move, and others. You will also learn how to override MediaProvider using hooks.

How to do it…

We will first create an event handler class where we will create some event handling methods:

  1. In the SitecoreCookbook project, create an event handler ...

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.