slsLog

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProjectName     = "teams-api"
	AccessKeyID     = config.C.Oss.AccessKeyId
	AccessKeySecret = config.C.Oss.AccessKeySecret
	Endpoint        = "cn-zhangjiakou.log.aliyuncs.com" // just like cn-hangzhou.log.aliyuncs.com
	LogStoreName    = "api-log-store"
	Client          sls.ClientInterface
)

Functions

func CreatIndex

func CreatIndex(ProjectName, LogStoreName string) error

func CreateLogStore

func CreateLogStore(ProjectName, LogStoreName string) error

func DeleteLog

func DeleteLog(ProjectName, LogStoreName string)

func GetHistograms

func GetHistograms(ProjectName, LogStoreName string) error

func GetLogByQueryExp

func GetLogByQueryExp(ProjectName, LogStoreName, topic, QueryExp string, num, offset int64) error

func PutLogs

func PutLogs(ProjectName, LogStoreName, Ip, topic string, logs []*sls.Log) error

func SendKafka

func SendKafka(logsByte []byte)

Types

type SlsLogFormt

type SlsLogFormt struct {
	LogLevel   string `json:"logLevel"`
	LogContent any    `json:"logContent"`
}

func (SlsLogFormt) PrintLogToSls

func (slsF SlsLogFormt) PrintLogToSls(nowTime int64)

将运行日志写入 阿里云sls 中

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL