Logs written to local files on the client are synced to the log server in the following ways.
Automatic upload: Logs are uploaded automatically when specific conditions are met.
Log switch upload: The conditions for automatic uploads are modified based on switch values sent from the server.
Manual upload: You can force an upload by calling the log upload API.
Automatic upload
An automatic log upload is triggered under the following conditions:
An upload is triggered when the number of cached local logs reaches a specific count. The rules are:
Activity, startup speed, stuttering, freeze, and crash logs are uploaded in real time.
Custom event logs and automated logs are uploaded when their count reaches 50.
An upload is triggered when the application moves to the background.
Log switch upload
In addition to the default log reporting triggers described above, you can dynamically control when logs are reported through the console's Mobile Analytics > Log Management > Configure Upload Toggle page.
where:
Upload Switch: The log and switch configurations take effect only when this switch is enabled.
Network: Choose to upload logs on All networks or Only on WiFi.
Business Code: Corresponds to the business code (bizType) used for client instrumentation. For a list of common business codes, see View local logs.
Log Upload Count: The number of logs of a specific type in a local file that triggers an upload.
Log Upload Ratio: The ratio of users for whom logs are uploaded. The value is a ratio out of 1,000. For example, a value of 1000 means logs are uploaded for all users.
Minimum Upload Level: Each log is assigned a level when it is written. Only logs with a level less than or equal to this value are uploaded. For example, if the minimum upload level is set to 2, logs with levels 1 and 2 are uploaded, but logs with level 3 are not.
For more information, see Configure log upload switches.
Manual upload
You can manually report in the following ways:
MPLogger.uploadAll();Custom device ID
The custom device ID feature is supported in baseline version 10.2.3.75 and later.
MPLogger.setClientId(String clientId);