Technical instruction - WebViewer Usage Log
Version 5.2 and later.
I. Overview
The WebViewer now has a component to log various user actions. We refer to this type of logging as Usage Logs. This information is destined for customers to get information on how the WebViewer is used. This documentation will focus on how the environment must be configured to get UsageLog component and see logs in the WebViewer.
II. Configuration
The component relies on three settings:
UsageLogEnabled: Set it to true if you want to use UsageLog, false otherwise
ApiBaseAddress: It should be the same as the hostname you have for the Issuer in the UsageLog API Auth config section
ApiKey: You should be able to get one by asking the person who was in charge of setting up the API
ApiTimeout: Increase this in case the network has some base latency. The default is set to 2000 ms (2 seconds)
To configure the Usage Log component, you can either use a config file or do it within the WebAdmin UI directly. Regardless of which option you choose to go with, you will need to set all three settings.
1. Using a config file
If you want to do it via file, you can either create a new Profile Snippet or add the configuration directly in the main profile.config file.
<UsageLogEnabled>true</UsageLogEnabled>
<UsageLogSettings>
<ApiBaseAddress>https://example.com/UsageLogApi</ApiBaseAddress>
<ApiKey>YOUR-API-KEY-HERE</ApiKey>
<ApiTimeout>2000</ApiTimeout>
</UsageLogSettings>
2. Using the Configuration panel
If you head over to the WebViewer and go to Administrate > Configuration, you should see a Usage Log section:
III. View usage logs
If you followed this guide thoroughly, UsageLog should now be turned on. To test it, you can run the WebViewer and go to Administrate > Site (/admin/DashBoard URL). A new menu item should be present on the left:
When clicking the button, you should get the following view. Each row corresponds to a specific usage log event.
IV. Common issues
Invalid or missing API key
If you are unable to view any log in the UsageLog view page, it is likely that your API key is outdated or missing.
You should be able to find a valid API key in the KeePass. If you cannot find the key, or it does not work, please get in touch with a developer.
For security purpose, API keys are only valid for a certain time and new ones need to be generated once the validation period expires.
API timeout set too low
If you get exceptions similar to this one:
Failed to send GetLogs request: One or more errors occurred. A task was canceled.
Then, it is likely that the configured ApiTimeout
is too low. Try increasing it to a high value in the settings.