logbot

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 16 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

This section is empty.

Functions

func AfterServerBootstrapped

func AfterServerBootstrapped(rail miso.Rail) error

func BeforeServerBootstrapp

func BeforeServerBootstrapp(rail miso.Rail) error

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 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   miso.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    miso.ETime
	Level   string
	TraceId string
	SpanId  string
	Caller  string
	Message string
}

type LogLineEvent

type LogLineEvent struct {
	App     string
	Node    string
	Time    miso.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   miso.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