Client Logs

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
    • Log level
  • Message data
    • Timestamp
  • Device OS Contextual data
    • Application name
    • Application version
    • Device OS
  • Device Contextual data
    • Device Id
    • Device model
    • Device OS version

Procedure

  1. Create a new hybrid application.
  2. Populate data by calling WL.Logger.log('Hello world!') or any of the other Logger APIs. Then call WL.Logger.send().
  3. 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.
  4. Click Create Chart to create a new custom chart.
  5. Provide the following values:
    • Chart Title: Application and Log Levels
    • Event Type: Client Logs
    • Chart Type: Flow Chart
  6. Click the Chart Definition tab.
  7. Provide the following values:
    • Source: Application Name
    • Destination: Level
    • Property: your application name
  8. Click Save.

Results

Figure 1. Application and Log Levels
Flow chart that shows application log levels.