tencent cloud

Log Plugin

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-05-21 16:57:16
The SDK provides the ability for log reporting. If your application does not have the log reporting function, you can add a log reporting plug-in.
Note:
After integrating the log plug-in, inform the Tencent Side to perform allowlist processing.

1. Dependency Integration

Configure MpAccSDK and MpLogPlugin under App Target, as shown below:



If the mode is VPN, make a similar configuration under VPN Target, as shown in the figure below (the difference is in the Embed option).



Note:
The system database introduced in VPN mode is NetworkExtension.framework. In Socks5 mode, only Network.framework is required, without NetworkExtension.

2. Example Code

Note:
The plug-in needs to be set before speed up.

2.1 VPN Access

// App Process
let logPlugin = MpLogPlugin(
setting: .vpnApp(dataKey: "xxxxxxxxxxxxx",
deviceId: "xxxxxxxxxxxxx",
groupId: "xxxxxxxxxxxxxx",
consoleEnabled: true))
AccPluginManager.shared.setLogUploadPlugin(logPlugin)
// VPN process
class PacketTunnelProvider: NEPacketTunnelProvider {
var mTunnelManager: MpPacketTunnelManager = MpPacketTunnelManager()
override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) {
// Add code here to start the process of connecting the tunnel.
let logPlugin = MpLogPlugin(setting: .vpnExtension(groupId: "xxxxxxxxxxxxxx", consoleEnabled: true))
AccPluginManager.shared.setLogUploadPlugin(logPlugin)
mTunnelManager.startTunnel(packetTunnel: self, options: options, completionHandler: completionHandler)
}
// .......
}

2.2 Socks5 Integration

//datakey registration method
let logPlugin = MpLogPlugin(
setting: .socks5(dataKey: "xxxxxxxxxxxxxxxxxxxx",
deviceId: "xxxxxxxxxxxxxxxxxxxx",
consoleEnabled: true,
justAutoUploadInWiFi: true))

//application signature registration method
let plugin = LogPlugin(setting: .socks5(appId: "xxx",
sign: "xxx",
consoleEnabled: true,
justAutoUploadInWiFi: true))
AccPluginManager.shared.setLogUploadPlugin(logPlugin)



ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック