Comments (3)
https://github.com/axiaoxin-com/logging/blob/master/example/lumberjack.go#L9 参考下这里
from logging.
https://github.com/axiaoxin-com/logging/blob/master/example/lumberjack.go#L9 参考下这里
这个样例我知道,我的疑问就在这边产生的。我定义了option之后,在logging的方法中没有找到将定义的option应用到现有logger中。
options := logging.Options{
LumberjackSink: logging.NewLumberjackSink("lumberjack", log_file, 7, 30, 1, true, true),
OutputPaths: []string{"lumberjack:"},
}
logger, _ := logging.NewLogger(options)
// 替换默认 logger
logging.ReplaceLogger(logger)
logging.GinLoggerWithConfig(logging.GinLoggerConfig{
TraceIDFunc: getTraceID,
})
return func(c *gin.Context) {
c.Next()
}
from logging.
logging.ReplaceLogger(logger) 这里把logging里用的默认logger替换了
from logging.
Related Issues (20)
- add SetDefaultAtomicLevelAddr function to change default http addr
- init支持从环境变量获取sentry dsn
- sqlxlogger
- add free functions for sentry capture with flush
- gorm logger 支持已指定的level来打印日志,现在是写死为debug打印
- gorm logger caller 需要skip,行数显示不对 HOT 1
- 初始化字段添加本机IP 并将初始化字段全部添加到sentry 附加信息中 HOT 1
- todo HOT 1
- remove DefaultLogger func HOT 1
- gorm 获取gin context 的traceId HOT 1
- gin的请求日志能不能在方法的最开始 HOT 5
- gin日志中间件里怎么设置输出到指定文件 HOT 3
- go mod中的goutils指定v1.0.22,在 goutils中无此tag HOT 1
- 使用了gin middleware: GinLogger怎么自定义日志字段 HOT 1
- 有没有和opentelemetry-go 的支持计划了
- sentry debug 参数支持传参
- lumberjack 文件路径不存在时自动创建 HOT 1
- 默认logger disable caller and stacktrace
- hot SetLevel for viper OnConfigChange
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logging.