SharePoint add-on for severity context-aware logging

At the beginning of the year, from our Digital Workplace Competence Center, we have delivered one of our most complex functional migration solutions so far.

Our client was a noted player within the financial industry, setting its new Digital Workplace for more than 5000 users. The migration involved a wide range of business processes & workflows, specific to the HR and Finance departments, such as archiving and request management, as well as User Access Rights Management-related functionalities such as employee management and access approval via a ticketing system. All features were split amongst seven applications on a SharePoint 2013 on-premise farm, resulting in an e-mail-driven application.

The need for security rigour and a smart maintenance service, which are vital for the financial industry, have pushed us to create a very powerful logging framework that was flexible enough to be shared by all applications, including the heavy data migration from the Lotus Notes application to SharePoint that was  a main part of the project.

The solutions behind the add-on

As opposed to the default logging mechanism used in SharePoint Standard that only stores information about the exact action that generated the error, our add-on uses ADO.NET logging to store comprehensive details such as request history – from creation/provisioning until finalization (e.g.: created by, created on, approved by, current status, timestamps for comments and sent), technical details not available by default (e.g.: the front-end server on which the error occurred), as well as the notification e-mails sent by the system that are also logged to the database. Another critical requirement was the e-mail alert component, which enables the administrators & support groups to react on various types of errors (critical or fatal errors) much faster than through the normal user-driven ticketing systems.

sharepoint-add-on

How does our notification system integrates within the migration solution.

In order to improve the maintainability of this add-on, one of the functionalities that was developed was contextual logging. Contextual logging provides information regarding current user, browser, locale and also values of input fields, and workflow/timer job parameters. Additionally, multiple log management possibilities such as file, ULS, database, e-mail have been created too, while the classic information logging option has been kept.

These functionalities are quite useful for debugging purposes as they provide detailed information that helps reproduce the error, testing and monitoring (by providing system health information to QA engineers/administrators that is otherwise not visible in the UI), or even provide valuable insight on user behaviour by analysing the business process execution steps as they were actually performed by the users enabling process engineers to take improvement steps.

The technical approach

We approached the challenge by building on top of already existing logging components in SharePoint (SPDiagnosticsService), Log4Net – covering message classification and routing to several trace targets (file, database, e-mail) based on an XML configuration that contributes to the overall flexibility – and finally ADO.NET logging to a SQL Server database that enables the advanced reporting and filtering functionalities mentioned above, otherwise not possible in standard file-based logging systems.

Due to all these features, we see that the solution can cross the borders of logging to auditing capabilities. This strategy can be applied for any SharePoint on-premise application or provider hosted app with minimal effort. Enabling contextual logging, however, is more time consuming, as this needs to couple tightly with the specific business processes themselves in order to provide real insights.