mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-12-19 05:47:00 +01:00
@@ -363,7 +363,20 @@ func (router *Router) logRequest(r *http.Request, succ bool, statusCode int, for
|
||||
// in that case we will log it by default and will not enter this routine
|
||||
return
|
||||
}
|
||||
if router.Option.StatisticCollector != nil && !endpoint.DisableStatisticCollection {
|
||||
|
||||
router.Option.Logger.LogHTTPRequest(r, forwardType, statusCode, originalHostname, upstreamHostname)
|
||||
|
||||
if router.Option.StatisticCollector == nil {
|
||||
// Statistic collection not yet initialized
|
||||
return
|
||||
}
|
||||
|
||||
if endpoint != nil && !endpoint.DisableStatisticCollection {
|
||||
// Endpoint level statistic collection disabled
|
||||
return
|
||||
}
|
||||
|
||||
// Proceed to record the request info
|
||||
go func() {
|
||||
requestInfo := statistic.RequestInfo{
|
||||
IpAddr: netutils.GetRequesterIP(r),
|
||||
@@ -381,5 +394,3 @@ func (router *Router) logRequest(r *http.Request, succ bool, statusCode int, for
|
||||
}()
|
||||
|
||||
}
|
||||
router.Option.Logger.LogHTTPRequest(r, forwardType, statusCode, originalHostname, upstreamHostname)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user