#import <TencentCloudLogProducer.h>
pod 'TencentCloudLogProducer/Core', '1.1.2'
Variable | Type | Required | Description |
endpoint | String | Yes | Regional information. For completion, see the domain name in the Log upload via API Tab under available region. |
secretId | String | Yes | TencentCloud API key information. For key information acquisition, please visit API Key Management. Please ensure the associated account has appropriate SDK log upload permission. |
secretKey | String | Yes | TencentCloud API key information. For key information acquisition, please visit API Key Management. Please ensure the associated account has appropriate SDK log upload permission. |
topicId | String | Yes | Log topic ID information. |
// Fill in domain information, see the domain name in the Log upload via API Tab at https://www.tencentcloud.com/document/product/614/18940?from_cn_redirect=1#.E5.9F.9F.E5.90.8DNSString* endpoint = @"project's_endpoint";// Fill in TencentCloud API key information. For key information acquisition, please visit: https://console.tencentcloud.com/cam/capi// Please ensure the associated account has appropriate log upload permissions. For permission configuration, see https://www.tencentcloud.com/document/product/614/68374?from_cn_redirect=1#.E4.BD.BF.E7.94.A8-api-.E4.B8.8A.E4.BC.A0.E6.95.B0.E6.8D.AE// It is advisable to obtain key information from environmental variablesNSString* accesskeyid = @"your_accesskey_id";NSString* accesskeysecret = @"your_accesskey_secret";// Set the topic ID for log upload, replace with your Topic IDNSString* topic_id = @"your_topic";LogProducerConfig *config = [[LogProducerConfig alloc] initWithCoreInfo:[endpoint] accessKeyID:[accesskeyid] accessKeySecret:[accesskeysecret];[config SetTopic:topic_id];[config SetPackageLogBytes:1024*1024];[config SetPackageLogCount:1024];[config SetPackageTimeout:3000];[config SetMaxBufferLimit:64*1024*1024];[config SetSendThreadCount:1];[config SetConnectTimeoutSec:10];[config SetSendTimeoutSec:10];[config SetDestroyFlusherWaitSec:1];[config SetDestroySenderWaitSec:1];[config SetCompressType:1];//If callback is null, it will not be called backLogProducerClient *client; = [[LogProducerClient alloc] initWithClsLogProducer:config callback:nil];Log* log = [[Log alloc] init];[log PutContent:@"cls_key_1" value:@"cls_value_1"];[log PutContent:@"cls_key_1" value:@"cls_value_2"];LogProducerResult result = [client PostLog:log];
Feedback