mirror of
https://github.com/versity/versitygw.git
synced 2026-05-01 09:45:43 +00:00
fix: always log internal server error messages to stderr
The debuglogger logs will only get printed if debug is enabled, but we always want the internal server error logs to be logged by the service since this is usually some actionable error that needs to be addressed with the backend storage system. This changes internal server error logs to always to sent to stderr.
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -3924,7 +3925,7 @@ func SendResponse(ctx *fiber.Ctx, err error, l *MetaOpts) error {
|
||||
return ctx.Send(s3err.GetAPIErrorResponse(apierr, "", "", ""))
|
||||
}
|
||||
|
||||
debuglogger.Logf("Internal Error, %v", err)
|
||||
fmt.Fprintf(os.Stderr, "Internal Error, %v\n", err)
|
||||
ctx.Status(http.StatusInternalServerError)
|
||||
return ctx.Send(s3err.GetAPIErrorResponse(
|
||||
s3err.GetAPIError(s3err.ErrInternalError), "", "", ""))
|
||||
@@ -3978,7 +3979,7 @@ func SendXMLResponse(ctx *fiber.Ctx, resp any, err error, l *MetaOpts) error {
|
||||
return ctx.Send(s3err.GetAPIErrorResponse(serr, "", "", ""))
|
||||
}
|
||||
|
||||
debuglogger.Logf("Internal Error, %v", err)
|
||||
fmt.Fprintf(os.Stderr, "Internal Error, %v\n", err)
|
||||
ctx.Status(http.StatusInternalServerError)
|
||||
|
||||
return ctx.Send(s3err.GetAPIErrorResponse(
|
||||
|
||||
Reference in New Issue
Block a user