LogConfig

Configuration of Agora SDK log files.

public class LogConfig
    {
        public LogConfig()
        {
            filePath = "";
            fileSizeInKB = 0;
            level = LOG_LEVEL.LOG_LEVEL_INFO;
        }

        public LogConfig(string filePath, uint fileSize = 1024, LOG_LEVEL level = LOG_LEVEL.LOG_LEVEL_INFO)
        {
            this.filePath = filePath;
            this.fileSizeInKB = 0;
            this.level = level;
        }
        public string filePath { set; get; }
        public uint fileSizeInKB { set; get; }
        public LOG_LEVEL level { set; get; }
    };

Attributes

filePath

The complete path of the log files. Agora recommends using the default log directory. If you need to modify the default directory, ensure that the directory you specify exists and is writable.

The default log directory is:
  • Android: /storage/emulated/0/Android/data/<packagename>/files/agorasdk.log.
  • iOS: App Sandbox/Library/caches/agorasdk.log.
  • macOS:
    • If Sandbox is enabled: App Sandbox/Library/Logs/agorasdk.log. For example, /Users/<username>/Library/Containers/<AppBundleIdentifier>/Data/Library/Logs/agorasdk.log.
    • If Sandbox is disabled: ~/Library/Logs/agorasdk.log
  • Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\agorasdk.log.
fileSizeInKB
The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is 2,048 KB. If you set fileSizeInKByte smaller than 128 KB, the SDK automatically adjusts it to 128 KB; if you set fileSizeInKByte greater than 20,480 KB, the SDK automatically adjusts it to 20,480 KB.
Attention:

This method applies to the agorasdk.log file only and does not take effect for the agoraapi.log file.

level

The output level of the SDK log file. See LOG_LEVEL.

For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.