Logging
Entity Service uses slf4j-api as the logging facade library. The appropriate adapter dependencies that makes sense for your logging setup, like slf4j-log4j2 or slf4j-nop will need to be added.
On Android, it's recommended to use logback-android.
Add dependencies
1 |
|
It is recommended to declare logback-android with runtimeOnly scope (comparable to the runtime scope in Maven). This means the classes are first available at runtime and not during development. This ensures that you are always programming against the Slf4j API.
Customize the configuration
Configuration is done in logback.xml which on Android is placed in the assets directory.
Below shows an example to log the SDK logs to logcat console.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Below shows an example to log the SDK logs to file #APP_LOG_PATH#/sdkLogs/sdkLog.log and the log files will be rotated by daily, meanwhile only the most recent 7 log files will be kept. Refer to document to get more details.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|