This commit is contained in:
2024-07-20 19:43:27 +08:00
parent 1b73e8d15c
commit 460fbba109
2 changed files with 3 additions and 2 deletions

View File

@@ -56,7 +56,8 @@ func LogComponent(startTime int64, r *http.Request) {
endTime := fmt.Sprintf(color, ms)
method := fmt.Sprintf("\033[1;32m%s\033[0m", r.Method) // 綠色加重
url := fmt.Sprintf("\033[1;34m%s\033[0m", r.URL) // 藍色加重
log.Println(method, url, endTime)
log.Println(method, url, endTime, r.Header.Get("X-Forwarded-For"))
}
type Image struct {

2
go.mod
View File

@@ -10,6 +10,7 @@ require (
github.com/elastic/go-elasticsearch/v8 v8.11.0
github.com/graphql-go/graphql v0.8.1
github.com/graphql-go/handler v0.2.3
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/jmoiron/sqlx v1.3.5
github.com/milvus-io/milvus-sdk-go/v2 v2.2.1
github.com/mitchellh/mapstructure v1.5.0
@@ -31,7 +32,6 @@ require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect