logbot

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorLogEventBus = "event.bus.logbot.log.error"
)
View Source
const (
	PropEnableRemoveErrLogTask = "logbot.remove-history-error-log"
)
View Source
const (
	ResourceManageLogbot = "manage-logbot"
)

Variables

View Source
var (
	ReportLogPipeline = rabbit.NewEventPipeline[ErrorLog]("logbot:error-log:report:pipeline").
		LogPayload()
)

Functions

func AfterServerBootstrapped

func AfterServerBootstrapped(rail miso.Rail) error

func BeforeServerBootstrap added in v0.0.13

func BeforeServerBootstrap(rail miso.Rail) error

func InitPipeline added in v0.0.13

func InitPipeline(rail miso.Rail)

func IsRmErrorLogTaskEnabled added in v0.0.2

func IsRmErrorLogTaskEnabled() bool

func RemoveErrorLogsBefore added in v0.0.2

func RemoveErrorLogsBefore(rail miso.Rail, upperBound time.Time) error

func SaveErrorLog

func SaveErrorLog(rail miso.Rail, evt LogLineEvent) error

func WatchLogFile

func WatchLogFile(rail miso.Rail, wc WatchConfig, nodeName string) error

Types

type Config

type Config struct {
	Config LogBotConfig `mapstructure:"logbot"`
}

func LoadLogBotConfig

func LoadLogBotConfig() Config

type ErrorLog added in v0.0.13

type ErrorLog struct {
	Node     string
	App      string
	Time     util.ETime
	TraceId  string
	SpanId   string
	FuncName string
	Message  string
}

type ListErrorLogReq

type ListErrorLogReq struct {
	App  string      `json:"app"`
	Page miso.Paging `json:"page"`
}

type ListErrorLogResp

type ListErrorLogResp struct {
	Page    miso.Paging      `json:"page"`
	Payload []ListedErrorLog `json:"payload"`
}

func ListErrorLogs

func ListErrorLogs(rail miso.Rail, r ListErrorLogReq) (ListErrorLogResp, error)

type ListedErrorLog

type ListedErrorLog struct {
	Id      int64      `json:"id"`
	Node    string     `json:"node"`
	App     string     `json:"app"`
	Caller  string     `json:"caller"`
	TraceId string     `json:"traceId"`
	SpanId  string     `json:"spanId"`
	ErrMsg  string     `json:"errMsg"`
	RTime   util.ETime `json:"rtime" gorm:"column:rtime"`
}

type LogBotConfig

type LogBotConfig struct {
	NodeName     string        `mapstructure:"node"`
	WatchConfigs []WatchConfig `mapstructure:"watch"`
}

type LogLine

type LogLine struct {
	Time    util.ETime
	Level   string
	TraceId string
	SpanId  string
	Caller  string
	Message string
}

type LogLineEvent

type LogLineEvent struct {
	App     string
	Node    string
	Time    util.ETime
	Level   string
	TraceId string
	SpanId  string
	Caller  string
	Message string
}

type SaveErrorLogCmd

type SaveErrorLogCmd struct {
	Node    string
	App     string
	Caller  string
	TraceId string
	SpanId  string
	ErrMsg  string
	RTime   util.ETime `gorm:"column:rtime"`
}

type WatchConfig

type WatchConfig struct {
	App  string
	File string
	Type string
}

Jump to

Keyboard shortcuts

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