access log add detour tag

This commit is contained in:
fcying
2019-06-14 14:43:42 +08:00
parent 8cf38342e9
commit 23e5d3cd12
6 changed files with 35 additions and 6 deletions
+7
View File
@@ -14,6 +14,7 @@ import (
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/net"
"v2ray.com/core/common/log"
"v2ray.com/core/common/protocol"
"v2ray.com/core/common/session"
"v2ray.com/core/features/outbound"
@@ -281,5 +282,11 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
return
}
accessMessage := log.AccessMessageFromContext(ctx)
if accessMessage != nil {
accessMessage.Detour = "[" + handler.Tag() + "]"
log.Record(accessMessage)
}
handler.Dispatch(ctx, link)
}