Giter Club home page Giter Club logo

tencentcloud-cls-sdk-js's Introduction

CLS JavaScript SDK

腾讯云CLS日志上传SDK, 支持nodejs

Install

npm i tencentcloud-cls-sdk-js

Configuration

Config Name Default Type Required Description
secretId string true Your access key to CLS
secretKey string true Your secret to access CLS
endpoint string true Your CLS endpoint, e.g. ap-guangzhou.cls.tencentcs.com
sourceIp string true 本机ip
retry_times integer true 重试次数
topic_id string true CLS日志服务日志主题ID

CLS Host

本项目使用 日志服务 API 2017

https://cloud.tencent.com/document/product/614/18940

Example


// CLS日志服务日志主题ID; 必填参数
let topicID = "xxxx"

let client = new AsyncClient({
            endpoint: "ap-guangzhou.cls.tencentcs.com",
            secretId: "[secretId]", 
            secretKey: "[secretKey]",
            sourceIp: "127.0.0.1",
            retry_times: 10,
        });

let item = new LogItem()
item.pushBack(new Content("__CONTENT__", "你好,我来自深圳|hello world2"))
item.setTime(Math.floor(Date.now()/1000))

let loggroup = new LogGroup()
loggroup.addLogs(item)
let request = new PutLogsRequest(topicID, loggroup);
let data = await client.PutLogs(request);
console.log(data)

Features

  • 支持lz4压缩上传

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.