Key Scenarios
This section describes the most common situations in which you might use the SharePoint Logger. Each topic in this section describes a realistic scenario, identifies the solution, and provides code to demonstrate how to use the SharePoint Logger to complete the task. Each topic also includes usage notes and hints, where applicable.
The scenarios are as follows:
- Logging an Unhandled Exception. This scenario illustrates how you can use the SharePoint Logger to report an unhandled exception to the event log and the trace log.
- Using Feature Receivers to Configure Diagnostic Areas and Categories. This scenario illustrates how you can use a SharePoint feature receiver class to create and register custom diagnostic areas and categories for your own SharePoint solutions.
- Using the SharePoint Logger from Sandboxed Code. This scenario illustrates how you can register the logging proxy to enable logging for applications in the sandbox.
- Customizing the Logger for Unit Testing. This scenario illustrates how you can create a mock logger implementation to use in your unit tests.
- Customizing the Logger in an Application. This scenario illustrates how you can override the default functionality of the SharePoint Logger to meet any custom logging requirements.