Documentation ¶
Index ¶
Constants ¶
View Source
const ( AppName = config.LogName SubLoggerKey = "component" )
Variables ¶
This section is empty.
Functions ¶
func TextHandler ¶
func TextHandler() *slog.TextHandler
Types ¶
type Logger ¶
type Logger struct { ioc.ObjectImpl Otlp bool `json:"otlp" yaml:"otlp"` // 开启trace Level slog.Level `json:"level" yaml:"level"` // 级别 Filename string `json:"filename" yaml:"filename"` // 日志文件名 MaxSize int `json:"maxSize" yaml:"maxSize"` // 触发滚动的文件大小,单位 megabytes MaxAge int `json:"maxAge" yaml:"maxAge"` // 触发滚动的文件保留时间,单位 day MaxBackups int `json:"maxBackups" yaml:"maxBackups"` // 滚动时,旧文件保留多少分 LocalTime bool `json:"LocalTime" yaml:"LocalTime"` // 备份文件的时间格式 Compress bool `json:"compress" yaml:"compress"` // 备份文件是否进行压缩 Deep int `json:"deep" yaml:"deep"` // 文件路径深度 // contains filtered or unexported fields }
func (*Logger) HandlerConsole ¶
func (l *Logger) HandlerConsole() *slog.TextHandler
func (*Logger) HandlerFile ¶
func (l *Logger) HandlerFile() *slog.JSONHandler
Click to show internal directories.
Click to hide internal directories.