diff --git a/sda-download/api/api.go b/sda-download/api/api.go index 7a4b087c7..59e28eb6a 100644 --- a/sda-download/api/api.go +++ b/sda-download/api/api.go @@ -41,6 +41,7 @@ func Setup() *http.Server { router.Use(gin.LoggerWithConfig( gin.LoggerConfig{ Formatter: func(params gin.LogFormatterParams) string { + // log if in debug mode, if a download was requested or if the request failed if log.GetLevel() == log.DebugLevel || strings.HasPrefix(params.Path, "/s3/") || params.StatusCode >= 400 { s, _ := json.Marshal(map[string]any{ "level": "debug", diff --git a/sda-download/api/sda/sda.go b/sda-download/api/sda/sda.go index e531606c0..76a25340a 100644 --- a/sda-download/api/sda/sda.go +++ b/sda-download/api/sda/sda.go @@ -103,7 +103,6 @@ func reencryptHeader(oldHeader []byte, reencKey string) ([]byte, error) { return nil, err } - log.Debugf("Response from the reencrypt service: %v", res) return res.Header, nil } @@ -383,7 +382,6 @@ func Download(c *gin.Context) { } log.Debugf("Public key from the request header = %v", reencKey) - log.Debugf("old c4gh file header = %v\n", fileDetails.Header) newHeader, err := reencryptHeader(fileDetails.Header, reencKey) if err != nil { log.Errorf("Failed to reencrypt the file header, reason: %v", err) @@ -391,7 +389,6 @@ func Download(c *gin.Context) { return } - log.Debugf("Reencrypted c4gh file header = %v", newHeader) newHr := bytes.NewReader(newHeader)