Sitecore Azure App Insights Log Viewer

No comments

Many Sitecore administrators and developers usually go and check traditional file system logs for Sitecore instance and they realize that the Sitecore Azure PaaS offering stores the logs in Azure Application Insights.

Though storing Sitecore logs in Azure Application Insights comes with lot of benefits compared to the file system, it is sometimes difficult for developers to access it as they need to learn Azure App Log Queries. Also, many non-technical users who would like to check Sitecore application logs cannot actually do it through Sitecore backend.

This made me to create a simple , easy to use Log viewer for Sitecore sites which use Azure Application insights to store logs.

Sitecore App Insights Log Viewer
Image 1 : Sitecore App Insights Log Viewer

How to install it ?

The module can be downloaded from Sitecore Market Place or it is also available in Github repository.

After installing it using Sitecore Package Installation wizard, please make sure to update AppId and AppKey in below config (App_Config/Include/Modules/AzureAppInsightsLogViewer/SitecoreAzureLogViewer.config)

SitecoreAzureLogViewer.config
Image 2 : SitecoreAzureLogViewer.config

Creating API key in Azure App Insights is simple. Go to Azure App insights, click on “Create api Key”, Provide a name and then copy the API Key.

Image 3 : Create API Key in Azure App Insights
Image 3 : Create API Key in Azure App Insights
Create Api Key
Image 4 : Create Api Key
Image 5 : Copy Api Key

How to use it ?

Once the module is installed, it can be accessed from Sitecore Launch pad as shown in below image.

Accessing Sitecore App Insights Log Viewer
Image 6 : Accessing Sitecore App Insights Log Viewer

The tool has a set of form inputs which makes it simple to filter Sitecore logs.

Form Inputs Sitecore App Insights Log Viewer
Image 7 : Form Inputs
  • Cloud Instances : It let’s you to select one of the many Sitecore instances that are uses same Application insights to store logs. You can filter logs from CMS, CD , Reporting , Processing instancesI feel this is really useful when you will have review logs from different instances !
  • Message Filter (optional) : There is dropdown to choose one of the string functions ( contains, startswith,endswith, not contains) and a text input next to it to filter Logs based on certain strings.
  • Date picker : The picker is very useful to filter logs within specific Date time range.
  • Log Types : You can select multiple log types ( Log type 1 : Information , type 2 : Warning , type 3 : Error )
  • Limit : Number of rows to be returned. The maximum limit configured in this tool is 5000 rows.

Once “Get Logs” button is clicked , it fetches results from Azure App Insights and displays it in a table below. The table also has a simple search box to filter specific text inside the table data. It also has buttons to export results in CSV, Excel or to copy it as HTML.

Azure App insights log viewer Export
Image 8 : Exporting table data
Sitecore Azure App Insights Log Viewer Gif
Image 9 : Sitecore Azure App Insights Log Viewer

I hope this simple tool makes life easier for developers and admins to filter and view logs from Azure App Insights 😉 .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.