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.
How to install it ?
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)
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.
How to use it ?
Once the module is installed, it can be accessed from Sitecore Launch pad as shown in below image.
The tool has a set of form inputs which makes it simple to filter Sitecore logs.
- 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 instances – I 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.
I hope this simple tool makes life easier for developers and admins to filter and view logs from Azure App Insights 😉 .