mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: set zap logging to wsproxy
Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
parent
584576d672
commit
b364b48475
@ -357,6 +357,18 @@ func (sctx *serveCtx) registerGateway(dial func(ctx context.Context) (*grpc.Clie
|
||||
return gwmux, nil
|
||||
}
|
||||
|
||||
type wsProxyZapLogger struct {
|
||||
*zap.Logger
|
||||
}
|
||||
|
||||
func (w wsProxyZapLogger) Warnln(i ...interface{}) {
|
||||
w.Warn(fmt.Sprint(i...))
|
||||
}
|
||||
|
||||
func (w wsProxyZapLogger) Debugln(i ...interface{}) {
|
||||
w.Debug(fmt.Sprint(i...))
|
||||
}
|
||||
|
||||
func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.ServeMux {
|
||||
httpmux := http.NewServeMux()
|
||||
for path, h := range sctx.userHandlers {
|
||||
@ -376,6 +388,7 @@ func (sctx *serveCtx) createMux(gwmux *gw.ServeMux, handler http.Handler) *http.
|
||||
},
|
||||
),
|
||||
wsproxy.WithMaxRespBodyBufferSize(0x7fffffff),
|
||||
wsproxy.WithLogger(wsProxyZapLogger{sctx.lg}),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user