How to set and get ZIM SDK log information?
Each platform can set and get ZIM SDK log information according to the following methods.
Android
In the "/storage/Android/data/[application package name]/files/ZIMLogs" path, TXT files starting with "zimlog" are log information.
Taking setting the log storage path to "/data/user/0/package name/files" and the maximum size of a single log file to 5MB as an example:
ZIMLogConfig logConfig;
// Set log storage path
logConfig.logPath = getApplicationContext().getFilesDir().getAbsolutePath();
// Set the maximum size of a single log file
logConfig.logSize = 5242880L;
ZIM.setLogConfig(logConfig);API Reference: ZIMLogConfig, setLogConfig
iOS/iPadOS
- Connect the iOS device to Mac, open Xcode, and select "Window > Devices and Simulators" from the top menu bar.

- Select the specified device on the left, then find the App that needs to get logs in "INSTALLED APPS", click the gear icon below, select "Download Container..." and save.

- Open "Finder" to find the saved ".xcappdata" file, right-click and select "Show Package Contents", select "AppData > Library > Caches > ZIMLogs" directory. TXT format files starting with "zimlog" are log information.
Taking setting the log storage path to "[[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingString:@"/ZegoLogs"]" and the maximum size of a single log file to 5MB as an example:
// Set log storage path
NSString *appLogPath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingString:@"/ZegoLogs"];
ZIMLogConfig *logConfig = [[ZIMLogConfig alloc] init];
logConfig.logPath = appLogPath;
// Set the maximum size of a single log file
logConfig.logSize = 5 * 1024 * 1024;
[ZIM setLogConfig:logConfig];API Reference:
- iOS: ZIMLogConfig, setLogConfig
- macOS: ZIMLogConfig, setLogConfig
macOS
- Sandbox: In the "~/Library/Containers/[application package name Bundle ID]/Data/Library/Caches/ZIMLogs" path, TXT files starting with "zimlog" are log information.
- Non-sandbox: In the "~/Library/Caches/ZIMLogs" path, TXT files starting with "zimlog" are log information.
Windows
The log folder is named: "program process name" + "ZEGO.SDK". In "My Computer" path, directly enter "%APPDATA%" and press Enter to locate the log folder storage directory. TXT files starting with "zimlog" are log information.
Taking setting the log storage path to "/Users/zego/Log/log.txt" and the maximum size of a single log file to 5MB as an example:
ZIMLogConfig logConfig;
// Set log storage path
logConfig.logPath = "/Users/zego/Log/log.txt";
// Set the maximum size of a single log file
logConfig.logSize = 5242880L;
ZIM::setLogConfig(logConfig);API Reference: ZIMLogConfig, setLogConfig
Web/Mini Program
Web and mini program platforms cannot get local log files. Developers should call the uploadLog interface after calling the login interface to upload logs to ZEGO log center.
Other Platforms
When using cross-platform frameworks such as Flutter, Unity3D, uni-app, React Native, etc., refer to the native platform methods (iOS, Android, macOS, Windows, Web) mentioned above to get logs.
