Skip to content

Commit 0435d2d

Browse files
authored
Add structured logging for KIS proxy errors using slog (#10)
2 parents 8d2e4c3 + 4fc5f70 commit 0435d2d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

internal/server/handler_kis_proxy.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"log/slog"
78
"maps"
89
"net/http"
910
"strings"
@@ -98,7 +99,15 @@ func (s *Server) handleKISProxyPath(c fuego.ContextWithBody[kisProxyRequest], ra
9899
)
99100
result, err := impl.CallEndpoint(c.Context(), method, rawPath, trID, request)
100101
if err != nil {
101-
return respond(c, statusFromBrokerError(err, http.StatusInternalServerError), Response{
102+
status := statusFromBrokerError(err, http.StatusInternalServerError)
103+
slog.Error("KIS proxy endpoint error",
104+
"path", rawPath,
105+
"method", method,
106+
"tr_id", trID,
107+
"status", status,
108+
"error", err,
109+
)
110+
return respond(c, status, Response{
102111
OK: false,
103112
Error: err.Error(),
104113
Broker: brk.Name(),

0 commit comments

Comments
 (0)