Skip to content

Latest commit

 

History

History
131 lines (104 loc) · 4.66 KB

logging.rst

File metadata and controls

131 lines (104 loc) · 4.66 KB

Logging

Omnia provides a logging API for extensions to write logs to Omnia Foundation's logs database. There are three different types of logs in Omnia: System Logs, Queue Logs and Feature Logs.

System Logs is a general-purpose place for information or error logs from both Omnia Foundation and extensions. System Logs can be viewed in Omnia admin app at System > Logs

image

Queue Logs contains logs from queue messages jobs. For errors related to long-running operations like uploading extension packages or creating site collection, check the Queue Logs. Queue Logs can be viewed in Omnia admin app at System > Queues

image

The last type of logs is Feature Logs, which contains logs from custom code in feature activation, upgrade or deactivation. Feature Logs can be viewed in the feature detail page.

image

Logging in extension Web API

In extension API that inherit from SharePointContextProvidedController you can use the built-in Logging service to write to the System Logs.

For API that does not inherit from SharePointContextProvidedController, you can use OmniaApi factory to create the Logging service.

Logging in extension features

In Omnia feature you can write to System Logs using OmniaApi factory or write to Feature Logs using the built-in Log method

Logging in extension jobs

Similar to features, in jobs you can use the OmniaApi factory to write to System Logs. One important thing to note is that currently any uncachted error in queue job will be write to the Queue Logs, but for timer jobs you need to handle the error and explicitly write to the System Logs in your code.