Documentation ¶
Index ¶
- Constants
- func AppendOtelHeader(opts ...eureka.Option) []eureka.Option
- func Debug() *zerolog.Event
- func Error() *zerolog.Event
- func GetOutBoundIP() (ip string, err error)
- func GetReqeustHeader() map[string]string
- func Info() *zerolog.Event
- func Init(r *gin.Engine)
- func Log() *zero_mdc_log.Overlog
- func LogContextMiddleware(c *gin.Context)
- func MDC() *zero_mdc_log.MdcAdapter
- func NewReqeust(method, url string, body io.Reader) (*http.Response, error)
- func Panic() *zerolog.Event
- func SetLogger(configItems ...zero_mdc_log.ConfigItem) gin.HandlerFunc
Constants ¶
View Source
const ( POST = "POST" GET = "GET" )
Variables ¶
This section is empty.
Functions ¶
func AppendOtelHeader ¶
func AppendOtelHeader(opts ...eureka.Option) []eureka.Option
func GetReqeustHeader ¶
调用链的请求包装。将traceid(context)相关注入otel
func Log ¶
func Log() *zero_mdc_log.Overlog
func LogContextMiddleware ¶
* 将日志相关需要协程安全的信息放到MDC: 通过header传入MDC。 * 要使log能打印某个字段,需要两个条件:1. 将值设置在MDC;2. 初始化zero_log的时候将 * 字段加入到zero_log(AddGlobalFields)。
func MDC ¶
func MDC() *zero_mdc_log.MdcAdapter
func NewReqeust ¶
调用下一个请求时,将当前的MDC传入下一个请求。
func SetLogger ¶
func SetLogger(configItems ...zero_mdc_log.ConfigItem) gin.HandlerFunc
设置请求的middleware,每个请求写一些日志
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.