mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-10-31 00:14:21 +00:00
access log add detour tag
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user