feature/318_add_logs #319

Merged
alexvanin merged 9 commits from dkirillov/frostfs-s3-gw:feature/318_add_logs into master 2024-09-04 19:51:13 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 7b86bac6ee - Show all commits

View file

@ -293,7 +293,7 @@ func determineBucketOperation(r *http.Request) string {
}
}
return ""
return "UnmatchedBucketOperation"
}
func determineObjectOperation(r *http.Request) string {
@ -357,12 +357,12 @@ func determineObjectOperation(r *http.Request) string {
}
}
return ""
return "UnmatchedObjectOperation"
}
func determineGeneralOperation(r *http.Request) string {
if r.Method == http.MethodGet {
return ListBucketsOperation
}
return ""
return "UnmatchedOperation"
}

View file

@ -148,6 +148,7 @@ func NewRouter(cfg Config) *chi.Mux {
defaultRouter := chi.NewRouter()
defaultRouter.Mount(fmt.Sprintf("/{%s}", s3middleware.BucketURLPrm), bucketRouter(cfg.Handler, cfg.Log))
defaultRouter.Get("/", named("ListBuckets", cfg.Handler.ListBucketsHandler))
attachErrorHandler(defaultRouter)
hr := NewHostBucketRouter("bucket")
hr.Default(defaultRouter)
@ -182,7 +183,7 @@ func errorResponseHandler(w http.ResponseWriter, r *http.Request) {
})
if log := s3middleware.GetReqLog(ctx); log != nil {
log.Error(logs.RequestUnmatched, zap.String("method", reqInfo.API))
log.Error(logs.RequestUnmatched, zap.String("method", reqInfo.API), zap.String("http method", r.Method), zap.String("url", r.RequestURI))
}
}