Skip to content

Commit

Permalink
Merge pull request #56 from anchore/more-logging-improvements
Browse files Browse the repository at this point in the history
chore: change log level of error responses to Harbor requests to Info
  • Loading branch information
zhill authored Aug 31, 2023
2 parents cbe76ac + 37a6e33 commit 07bb673
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/http/api/v1/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ func (h *APIHandler) GetHarborVulnerabilityReport(
scanId string,
includeFullDescriptions bool,
) (harbor.VulnerabilityReport, error) {
log.WithFields(log.Fields{"scanId": scanId, "includeFullDescriptions": includeFullDescriptions}).Info("handling request for harbor vulnerability report")
log.WithFields(log.Fields{"scanId": scanId, "includeFullDescriptions": includeFullDescriptions}).
Info("handling request for harbor vulnerability report")
report, err := h.scanner.GetHarborVulnerabilityReport(scanId, includeFullDescriptions)
if err != nil {
return harbor.VulnerabilityReport{}, err
Expand Down Expand Up @@ -284,7 +285,7 @@ func SendJsonResponse(res *http.ResponseWriter, obj interface{}, contentType str
}

func SendErrorResponse(res *http.ResponseWriter, message string, code int) {
log.WithFields(log.Fields{"message": message, "code": code}).Error("returning error response")
log.WithFields(log.Fields{"message": message, "code": code}).Info("returning error response")
resp := *res
resp.Header().Set(ContentTypeHeader, ErrorResponseMimeType)
errResp := harbor.ErrorResponse{Error: harbor.Error{Message: message}}
Expand Down

0 comments on commit 07bb673

Please sign in to comment.