logo
On this page

How to set logs for files/whiteboards?

2022-11-15
Products / Plugins:Interactive whiteboard / File sharing
Platform / Framework:iOS / Android

Problem Description

Where does the File Sharing SDK and Interactive Whiteboard SDK save logs by default? Why when using the log upload function of ZEGO audio and video SDK to report logs, the log information reported cannot find the log information of the Interactive Whiteboard SDK and File Transcoding SDK?

Problem Cause

The log reporting function of the audio and video SDK only uploads log files in the log path set by the audio and video SDK. The interactive whiteboard log path and file transcoding path set by the customer are different from the audio and video SDK log path, which will cause the reported logs to be missing.

Solution

To make it more convenient for users to use the File Sharing SDK and Interactive Whiteboard SDK, if the log path is not specified when initializing the SDK, the default address will be used as the path for writing logs (the default log storage paths of the File Sharing SDK and Interactive Whiteboard SDK are the same).

iOS default log path

[NSHomeDirectory() stringByAppendingPathComponent:@"Documents/ZegoLogFile"]

Android default log path

/sdcard/Android/data/your application package name/files/zegologs
  • If the version numbers of your Interactive Whiteboard SDK and File Transcoding SDK are both greater than or equal to 1.21.0, the SDK will set the log storage path by default, and developers do not need to set it manually again. After developers call the "uploadLog" interface of the audio and video SDK to report logs, the audio and video SDK will upload logs according to the default log paths of the Interactive Whiteboard and File Transcoding.

  • If the version numbers of your Interactive Whiteboard SDK and File Transcoding SDK are both less than 1.21.0, you can refer to the following code to set the log storage paths of the Interactive Whiteboard SDK, File Transcoding SDK, and audio and video SDK to be consistent.

iOS example:

NSString *appLogPath = [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingString:@"/ZegoLogs"];
// Set the log storage path for the audio and video SDK
ZegoLogConfig *logConfig = [[ZegoLogConfig alloc] init];
logConfig.logPath = appLogPath;
[ZegoExpressEngine setLogConfig:logConfig];

// Set the log storage path for the Interactive Whiteboard SDK
ZegoWhiteboardConfig *configw = [ZegoWhiteboardConfig new];
configw.logPath = appLogPath;
[[ZegoWhiteboardManager sharedInstance] setConfig:configw];

// Set the log storage path for the File Sharing SDK
ZegoDocsViewConfig * docsViewConfig = [ZegoDocsViewConfig new];
docsViewConfig.logFolder = appLogPath;
//...Set appid and other information
//...
//...
[[ZegoDocsViewManager sharedInstance] initWithConfig:docsViewConfig completionBlock:^(ZegoDocsViewError errorCode) {

}];

Android example:

String logPath = getApplicationContext().getFilesDir().getAbsolutePath() + File.separator + "zegologs";

// Set the log storage path for the audio and video SDK
ZegoLogConfig logConfig = new ZegoLogConfig();
logConfig.setLogPath(logPath);
ZegoExpressEngine.getEngine().setLogConfig(logConfig);

// Set the log storage path for the Interactive Whiteboard SDK
ZegoWhiteboardConfig whiteboardConfig = new ZegoWhiteboardConfig();
whiteboardConfig.setLogPath(logPath);
ZegoWhiteboardManager.getInstance().setConfig(whiteboardConfig);

// Set the log storage path for the File Sharing SDK
ZegoDocsViewConfig docsViewConfig = new ZegoDocsViewConfig();
docsViewConfig.setLogFolder(logFolder);
//... Set appid and other information
//...
//...

ZegoDocsViewManager.getInstance().init(docsViewConfig, new IZegoDocsViewInitListener() {
    @Override
    public void onInit(int errorCode) {

    }
});
  1. Interactive Whiteboard SDK Configuration|
  2. File Sharing SDK Configuration|

Previous

When pushing stream on Web end, error "code: 1103065, msg: Not Readable Error: device is not readable" is reported. How to handle?

Next

How to handle the issue where all interfaces of Super Board SDK are abnormal?

On this page

Back to top