Client logs contain log information sent with the platform's Logger API.
This also includes contextual information about the device, including
environment, application name, and application version.
Before you begin
If you are using the
WL.Client.logActivity API,
replace those calls with
WL.Analytics.log. Otherwise
you cannot create custom charts from the information you are logging.
Note: The
steps that follow use JavaScript APIs.
If you are using a native application, you must use the native versions
of these APIs.
About this task
In this example, you use client log data to create a flow
chart. The final graph shows the distribution of log levels in a specific
application. You also have the following data available to show in
a chart:
- Specific data
- Message data
- Device OS Contextual data
- Application name
- Application version
- Device OS
- Device Contextual data
- Device Id
- Device model
- Device OS version
Procedure
- Create a new hybrid application.
- Populate data by calling WL.Logger.log('Hello world!') or
any of the other Logger APIs. Then call WL.Logger.send().
- In the MobileFirst Analytics
Console, click the Custom Charts tab on the Dashboard page.
You can create a chart based on the analytics messages that were sent
to the server.
- Click Create Chart to create a new
custom chart.
- Provide the following values:
- Chart Title: Application and Log Levels
- Event Type: Client Logs
- Chart Type: Flow Chart
- Click the Chart Definition tab.
- Provide the following values:
- Source: Application Name
- Destination: Level
- Property: your application name
- Click Save.
Results
Figure 1. Application and Log Levels