Documentation ¶
Index ¶
- func LogInner(conn *Connection, fds ...Field) error
- func SetLogger(conn *Connection, configs ...Config) gin.HandlerFunc
- type Config
- func ConfigAppid(appid string) Config
- func ConfigCspanidHeader(cspanidHeader string) Config
- func ConfigEnvtype(envtype string) Config
- func ConfigExceptPrefix(exceptPrefix []string) Config
- func ConfigLogname(logname string) Config
- func ConfigLogthread(logthread string) Config
- func ConfigPort(port string) Config
- func ConfigPspanidHeader(pspanidHeader string) Config
- func ConfigRequestidHeader(requestidHeader string) Config
- func ConfigUseridHeader(useridHeader string) Config
- func ConfigWithBody(withBody bool) Config
- type Connection
- type Field
- func WithAppid(appid string) Field
- func WithCtx(ctx *gin.Context) Field
- func WithEnvtype(envtype string) Field
- func WithLevel(level string) Field
- func WithLogKey(key string) Field
- func WithLogMsg(logmsg string) Field
- func WithLogname(logname string) Field
- func WithLogthread(logthread string) Field
- func WithPort(port string) Field
- func WithRequestidHeader(requestidHeader string) Field
- func WithThrowable(throwable string) Field
- func WithUser(user string) Field
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogger ¶
func SetLogger(conn *Connection, configs ...Config) gin.HandlerFunc
SetLogger initializes the logging middleware.
Types ¶
type Config ¶
type Config interface {
// contains filtered or unexported methods
}
Config 配置
func ConfigCspanidHeader ¶
ConfigCspanidHeader 调用链header
func ConfigExceptPrefix ¶
ConfigExceptPrefix 排除路径
func ConfigPspanidHeader ¶
ConfigPspanidHeader 调用链header
func ConfigRequestidHeader ¶
ConfigRequestidHeader 调用链header
func ConfigUseridHeader ¶
ConfigUseridHeader 调用链header
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection 连接
func NewConnection ¶
func NewConnection(servers []string, topic string) (*Connection, error)
NewConnection 连接kafka
type Field ¶
type Field interface {
// contains filtered or unexported methods
}
Field 字段值
func WithRequestidHeader ¶
WithRequestidHeader 用户 ID-Name
Click to show internal directories.
Click to hide internal directories.