Documentation ¶
Index ¶
- Constants
- Variables
- func Level(level logrus.Level)
- func SetCallerSkip(skip int)
- func WithContext(ctx *gin.Context, params map[string]any) *logrus.Entry
- type EmptyWriter
- type FileHook
- type LogComponent
- type LogConf
- type LogConf_Clients
- type LogConf_FileClient
- type LogConf_FileClient_Rotation
- type LogConf_LokiClient
- type LogDriver
- type LokiHook
- type LokiReq
- type LokiReq_Stream
- type RotationType
- type StdoutHook
Constants ¶
View Source
const ( LogConfigName = "LogConf" LOG_DRIVER_STDOUT LogDriver = "stdout" LOG_DRIVER_FILE LogDriver = "file" LOG_DRIVER_LOKI LogDriver = "loki" ROTATION_TYPE_MINUTE RotationType = "minute" ROTATION_TYPE_HOUR RotationType = "hour" ROTATION_TYPE_DAY RotationType = "day" ROTATION_TYPE_MONTH RotationType = "month" ROTATION_TYPE_YEAR RotationType = "year" LOG_FIELD_LEVEL string = "level" LOG_FIELD_PARAMS string = "params" LOG_FIELD_MESSAGE string = "message" LOG_FIELD_DATETIME string = "datetime" LOG_FIELD_REPORTER string = "reporter" )
View Source
const ( PanicLevel logrus.Level = iota FatalLevel ErrorLevel WarnLevel InfoLevel DebugLevel TraceLevel )
Variables ¶
View Source
var Component = &LogComponent{}
Functions ¶
func SetCallerSkip ¶ added in v0.4.0
func SetCallerSkip(skip int)
Types ¶
type EmptyWriter ¶ added in v0.4.0
type EmptyWriter struct{}
func NewEmptyWriter ¶ added in v0.4.0
func NewEmptyWriter() *EmptyWriter
type FileHook ¶ added in v0.4.0
type FileHook struct{}
func NewFileHook ¶ added in v0.4.0
func NewFileHook() *FileHook
type LogComponent ¶ added in v0.4.0
type LogComponent struct{}
func (*LogComponent) Inject ¶ added in v0.4.0
func (i *LogComponent) Inject(instance any) bool
func (*LogComponent) InjectConf ¶ added in v0.4.0
func (i *LogComponent) InjectConf(config cComponents.ConfigInterface) bool
func (*LogComponent) Listen ¶ added in v0.4.0
func (i *LogComponent) Listen() []*cComponents.ConfigListener
func (*LogComponent) Load ¶ added in v0.4.0
func (i *LogComponent) Load()
type LogConf ¶
type LogConf struct { Level logrus.Level `json:"level"` Drivers []LogDriver `json:"drivers"` WithFields map[string]any `json:"with_fields"` Excludes []string `json:"excludes"` Clients *LogConf_Clients `json:"clients"` }
func (*LogConf) ConfigName ¶
type LogConf_Clients ¶ added in v0.0.52
type LogConf_Clients struct { File *LogConf_FileClient `json:"file"` Loki *LogConf_LokiClient `json:"loki"` }
type LogConf_FileClient ¶ added in v0.0.52
type LogConf_FileClient struct { Path string `json:"path"` Rotation *LogConf_FileClient_Rotation `json:"rotation"` }
type LogConf_FileClient_Rotation ¶ added in v0.0.52
type LogConf_FileClient_Rotation struct { Enable bool `json:"enable"` Type RotationType `json:"type"` MaxFile int64 `json:"max_file"` MaxSize int64 `json:"max_size"` }
type LogConf_LokiClient ¶ added in v0.0.52
type LokiHook ¶ added in v0.0.52
type LokiHook struct { Host string Uri string Queue []*logrus.Entry MaxSize int Speed int Timeout int64 Interval int64 }
func NewLokiHook ¶ added in v0.4.0
func NewLokiHook() *LokiHook
type LokiReq ¶ added in v0.0.52
type LokiReq struct {
Streams []*LokiReq_Stream `json:"streams"`
}
type LokiReq_Stream ¶ added in v0.0.52
type RotationType ¶ added in v0.0.52
type RotationType string
type StdoutHook ¶ added in v0.4.0
type StdoutHook struct{}
func NewStdoutHook ¶ added in v0.4.0
func NewStdoutHook() *StdoutHook
func (*StdoutHook) Levels ¶ added in v0.4.0
func (i *StdoutHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.