Updated on 2023-03-23 GMT+08:00

Customizing a Log Storage Path

You can customize a path for storing SDK logs in OpenSDKConfig.

Application Scenarios

The default log path of the SDK is /sdcard/Android/data/Application_package_name/files/log.

You can change the path for storing logs as required.

Precautions

1. After customizing the log storage path, ensure that logs are obtained from the same path. For details about how to obtain logs, see Collecting Android SDK Logs.

2. sdkConfig takes effect only when this configuration is passed during SDK initialization.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// Customize a log storage path.
public class CustomLoggerHandle implements ILoggerHandle {    
    private Application application;    
    public CustomLoggerHandle(Application application) {
        this.application = application;    
    }
    // Customize a log storage address.
    @Override    
    public String getLogPath() {
        return FileUtil.getExternalFilesDir(this.application) + "/log/meeting/";    
    }
}
sdkConfig.setLoggerHandle(new CustomLoggerHandle());