Log Analysis
Log Path
The log path of the OBS Android SDK is specified using LogConfigurator.setLogFileDir. Logs are saved in the logs directory of the SD card by default. The log file name is OBS-SDK.log.
Log Format
The SDK log format is: Log time|thread ID|log level|log content. The following are examples:
2017-08-21 17:40:07 133|main|INFO |HttpClient cost 157 ms to apply http request 2017-08-21 17:40:07 133|main|INFO |Received expected response code: true 2017-08-21 17:40:07 133|main|INFO |expected code(s): [200, 204]. 2017-08-21 17:40:06 820|main|INFO |Storage|1|HTTP+XML|ObsClient||||2017-08-21 17:40:05|2017-08-21 17:40:06|||0| 2017-08-21 17:40:07 136|main|INFO |Storage|1|HTTP+XML|setObjectAcl||||2017-08-21 17:40:06|2017-08-21 17:40:07|||0| 2017-08-21 17:40:07 137|main|INFO |ObsClient [setObjectAcl] cost 312 ms
Log Level
When current logs cannot be used to troubleshoot system faults, you can change the log level to obtain more information. You can obtain the most information in TRACE logs and the least information in ERROR logs. You can call LogConfigurator.setLogLevel to set bucket tags.
The following table describes each log level in detail.
Log Level |
Description |
Value in OBS Android SDK |
---|---|---|
OFF |
Close level. If this level is set, logging will be disabled. |
LogConfigurator.OFF |
TRACE |
Trace level. If this level is set, all log information will be printed. This level is not recommended. |
LogConfigurator.TRACE |
DEBUG |
Debugging level. If this level is set, information about logs of the INFO level and above, HTTP/HTTPS request and response headers, and StringToSign information calculated by authentication algorithm will be printed. |
LogConfigurator.DEBUG |
INFO |
Information level. If this level is set, information about logs of the WARN level and above, time consumed for each HTTP/HTTPS request, and time consumed for calling the ObsClient API will be printed. |
LogConfigurator.INFO |
WARN |
Warning level. If this level is set, information about logs of the ERROR level and above, as well as information about some critical events (for example, the number of retry attempts exceeds the upper limit) will be printed. |
LogConfigurator.WARN |
ERROR |
Error level. If this level is set, only error information will be printed. |
LogConfigurator.ERROR |
Log File Cannot Be Generated
If logs cannot be generated, check whether the following permissions are added in AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.