优化开放接口日志分类
This commit is contained in:
@@ -43,6 +43,8 @@ func OpenAuth(cfg OpenAuthConfig) gin.HandlerFunc {
|
||||
}
|
||||
return func(c *gin.Context) {
|
||||
reqID := openlog.EnsureReqID(c)
|
||||
side, action := openlog.ScopeFromPath(openlog.SideClient, c.Request.Method, c.Request.URL.Path)
|
||||
openlog.SetScope(c, side, action)
|
||||
c.Set(openlog.CtxDebug, cfg.Debug)
|
||||
c.Set(openlog.CtxStart, time.Now())
|
||||
c.Header("X-Request-Id", reqID)
|
||||
|
||||
@@ -55,6 +55,8 @@ func SourceOpenAuth(cfg SourceOpenAuthConfig) gin.HandlerFunc {
|
||||
store := newSourceNonceStore()
|
||||
return func(c *gin.Context) {
|
||||
reqID := openlog.EnsureReqID(c)
|
||||
side, action := openlog.ScopeFromPath(openlog.SideSource, c.Request.Method, c.Request.URL.Path)
|
||||
openlog.SetScope(c, side, action)
|
||||
c.Set(openlog.CtxDebug, cfg.Debug)
|
||||
c.Set(openlog.CtxStart, time.Now())
|
||||
c.Header("X-Request-Id", reqID)
|
||||
|
||||
Reference in New Issue
Block a user