// Logger (optional)TDLogConfig logConfig = new TDLogConfig.Builder(context).setLogPath(logPath) // Log output directory. Write permission must be obtained in advance..setLogLevel(LogLevel.DEBUG) // Default: VERBOSE.setConsoleLog(true) // Default: true.setMaxFileSize(byte) // Default: 50 MB.setMaxAliveFileSize(byte) // Default: unlimited, minimum: 200.setMaxAliveDay(day) // Default: 7 days, minimum: 1 day.setPubKey(pubKey) // Public key for log encryption (optional). Contact the RUM Pro assistant to configure the key pair on the backend..build();TDLog.initialize(context, logConfig);// DiagnoseTDDiagConfig diagConfig = new TDDiagConfig.Builder().setAppId(appId) // [Important] App ID obtained from RUM Pro.setAppKey(appKey) // [Important] App Key obtained from RUM Pro.setEnvironment(TDDiagConfig.ENV_CLOUD) // [Important] Sets the environment. For Tencent Cloud, use TDDiagConfig.ENV_CLOUD..setLoggerAdapter(TDLog.getLogImpl()) // Integrate with your own log tools by implementing LoggerAdapter..setDeviceInfoAdapter(deviceInfoAdapter) // Inject privacy information as required by privacy compliance. Optional; defaults to reading from android.os.Build..setAppVersion("1.0.0") // Custom app version. Optional; defaults to reading from PackageInfo..setTrafficQuota(total, metered) // Sets daily traffic quota. Optional; unlimited by default. Recommended to set..setUploadCountLimit(limit, period, timeUnit) // Sets automatic reporting frequency limit. Optional; unlimited by default. Recommended to set..setImportantLabels(...label) // Sets an allowlist of tags that are exempt from TrafficQuota and UploadCountLimit..build();TDDiag.initialize(context, config);
TDLog.i("tag", "xxxxxx");TDLog.e("tag", "xxxxxx", e);
TDDiag.setUserId("uid");
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback