我正在使用Kubernetes和helm图表在系统中部署一些微服务应用程序。其他服务将使用Netcat来等待waiter-service的运行,但是这个waiter-service服务在由delve启动时似乎不能正常工作,所以我想检查它的日志。
dockerfile的入口点如下所示:
/dlv --listen=:40000 --log --log-output=rpc --allow-non-terminal-interactive=true
--api-version=2 exec /server -- appname --config=configfile.yaml我收到的日志如下:
2022-08-24T13:22:11Z debug layer=rpc serving JSON-RPC on new connection
2022-08-24T13:22:11Z debug layer=rpc <- RPCServer.SetApiVersion(api.SetAPIVersionIn{"APIVersion":2})
2022-08-24T13:22:11Z debug layer=rpc -> *api.SetAPIVersionOut{} error: ""
2022-08-24T13:22:11Z debug layer=rpc <- RPCServer.IsMulticlient(rpc2.IsMulticlientIn{})
2022-08-24T13:22:11Z debug layer=rpc -> *rpc2.IsMulticlientOut{"IsMulticlient":false} error: ""
2022-08-24T13:22:11Z debug layer=rpc (async 3) <- RPCServer.State(rpc2.StateIn{"NonBlocking":true})
2022-08-24T13:22:11Z debug layer=rpc (async 3) -> rpc2.StateOut{"State":{"Pid":14,"Running":false,"Recording":false,"CoreDumping":false,"currentThread":{"id":14,"pc":4652512,"file":"/usr/lib/go-1.18/src/runtime/rt0_linux_amd64.s","line":8,"function":{"name":"_rt0_amd64_linux","value":4652512,"type":0,"goType":0,"optimized":true},"goroutineID":0,"ReturnValues":null,"CallReturn":false},"Threads":[{"id":14,"pc":4652512,"file":"/usr/lib/go-1.18/src/runtime/rt0_linux_amd64.s","line":8,"function":{"name":"_rt0_amd64_linux","value":4652512,"type":0,"goType":0,"optimized":true},"goroutineID":0,"ReturnValues":null,"CallReturn":false}],"NextInProgress":false,"WatchOutOfScope":null,"exited":false,"exitStatus":0,"When":""}} error: ""
2022-08-24T13:22:11Z debug layer=rpc <- RPCServer.Recorded(rpc2.RecordedIn{})
2022-08-24T13:22:11Z debug layer=rpc -> *rpc2.RecordedOut{"Recorded":false,"TraceDirectory":""} error: ""但是当我用普通命令运行它时
/server appname --config=configfile.yaml我的预期日志如下:
2022/08/24 07:43:43 maxprocs: Leaving GOMAXPROCS=16: CPU quota undefined
2022-08-24T07:43:44.976Z INFO database/pool.go:35 database configuration {"MaxConns": 8, "RetryCount": 10, "RetryInterval (seconds)": 5}
2022-08-24T07:43:44.976Z INFO v4@v4.15.0/conn.go:355 Dialing PostgreSQL server {"host": "postgres-infras.emulator.svc.cluster.local"}
2022-08-24T07:43:44.980Z INFO nats/jetstream.go:335 nats jetstream connected
2022-08-24T07:43:45.090Z INFO zap/grpclogger.go:92 [core][Channel #1 SubChannel #2] Subchannel Connectivity change to READY {"system": "grpc", "grpc_log": true}问题是,我如何读取实际日志,以了解为什么waiter-service不能工作,而其他人可以呢?
发布于 2022-08-25 02:39:52
https://stackoverflow.com/questions/73474644
复制相似问题