slog icon indicating copy to clipboard operation
slog copied to clipboard

📑 Lightweight, configurable, extensible logging library written in Go. Support multi level, multi outputs and built-in multi file logger, buffers, clean, rotate-file handling.一个易于使用的,轻量级、...

Results 9 slog issues
Sort by recently updated
recently updated
newest added

**System (please complete the following information):** - OS: `macOS` - GO Version: `1.21.0` - Pkg Version: `0.5.4` **Describe the bug** 当我配置按日期的方式来滚动日志时,当大于 1 天时只能按 1 天来滚动日志。 **To Reproduce** ```go seconds :=...

unconfirmed

比如, xx.log.20240228, 包含的日志为 2024/02/27和 28号 12点 的日志,是不是 xx.log.20240228 应该包含 28号 0点-23:59点的?

bug

Is it any example to use cron for rotation logs at custom moment? I am trying to make new log file daily at midnight.

question

在程序运行过程,有时候为了定位问题,有动态设置日志级别的需求,但没有找到方便友好的设置接口。 slog.SetLogLevel(lvl)只在std logger上生效。 请问有没有方便友好的动态设置日志级别接口? ```go package logger import ( "github.com/gookit/slog" "github.com/gookit/slog/handler" "github.com/gookit/slog/rotatefile" ) var ( Log1 *slog.Logger Log2 *slog.Logger AppLog *slog.Record CfgLog *slog.Record ) func init() { logTemplate := "[{{datetime}}]...

question

**System (please complete the following information):** - OS: `linux` - GO Version: `1.21.5` **Describe the bug** 内建的 rotate 机制: - 在设置了 max backup 为 90 的情况下,只有3个备份。 - rotate 之后,gzip 压缩的...

unconfirmed

slog是否支持grom,具体该如何实现

question

windows 自动创建日志目录异常 slog: failed to handle log, error: write ./logs/info.log: file already closed ``` import ( "github.com/gookit/slog" "github.com/gookit/slog/handler" "github.com/gookit/slog/rotatefile" ) func Slog() { defer slog.MustClose() // DangerLevels 包含: slog.PanicLevel, slog.ErrorLevel,...

bug

设置之前: ${{\color{Green}\Huge{\textsf{ [INFO] \}}}}\$ |2024-05-17 16:22:43.458| (/root/signal-server/libs/ws_server.go:244) ${{\color{Green}\Huge{\textsf{ New connection \}}}}\$ 设置之后: ${{\color{Green}\Huge{\textsf{ [INFO] \}}}}\$ |2024-05-17 16:22:43.458| (/root/signal-server/libs/ws_server.go:244) New connection

question