Documentation ¶
Index ¶
Constants ¶
View Source
const ( LOG_CONTEXT_PREFIX = "logcontext-" REQUEST_IP = LOG_CONTEXT_PREFIX + "requestip" // 全局变量 REQUEST_ID = LOG_CONTEXT_PREFIX + "requestid" // 全局变量 USER_ID = LOG_CONTEXT_PREFIX + "userid" // 全局变量 SESSION_ID = LOG_CONTEXT_PREFIX + "sessionid" // 当前服务变量 APP_ID = LOG_CONTEXT_PREFIX + "appid" // 当前服务变量 ENV_TYPE = LOG_CONTEXT_PREFIX + "envtype" // 当前服务变量 )
Variables ¶
This section is empty.
Functions ¶
func SetLogContextToNewRequst ¶
将需要贯穿整个调用链的日志字段穿到下一个请求
func SetMdcFromHeaderMiddleware ¶
将请求header中的日志字段设置到MDC
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.