feat: http logging middleware + mcp random port (#74)
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/kandev/kandev/internal/agentctl/server/config"
|
||||
"github.com/kandev/kandev/internal/agentctl/server/instance"
|
||||
"github.com/kandev/kandev/internal/common/httpmw"
|
||||
"github.com/kandev/kandev/internal/common/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -33,6 +34,8 @@ func NewControlServer(cfg *config.Config, instMgr *instance.Manager, log *logger
|
||||
router: gin.New(),
|
||||
}
|
||||
|
||||
cs.router.Use(httpmw.RequestLogger(cs.logger, "agentctl-control"))
|
||||
|
||||
cs.setupRoutes()
|
||||
return cs
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/kandev/kandev/internal/agentctl/server/config"
|
||||
"github.com/kandev/kandev/internal/agentctl/server/process"
|
||||
"github.com/kandev/kandev/internal/common/httpmw"
|
||||
"github.com/kandev/kandev/internal/common/logger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -39,6 +40,8 @@ func NewServer(cfg *config.InstanceConfig, procMgr *process.Manager, log *logger
|
||||
},
|
||||
}
|
||||
|
||||
s.router.Use(httpmw.RequestLogger(s.logger, "agentctl-instance"))
|
||||
|
||||
s.setupRoutes()
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user