From 4b0bfa6ed60ab2563ef582e6e0ff7325276b9175 Mon Sep 17 00:00:00 2001 From: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:45:28 +0530 Subject: [PATCH] refactor: make logs which doesn't effect test result to debug (#1642) Signed-off-by: Sarthak160 --- pkg/proxy/integrations/postgresParser/postgres_parser.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/proxy/integrations/postgresParser/postgres_parser.go b/pkg/proxy/integrations/postgresParser/postgres_parser.go index f83d7a0f3..d2c471fe8 100755 --- a/pkg/proxy/integrations/postgresParser/postgres_parser.go +++ b/pkg/proxy/integrations/postgresParser/postgres_parser.go @@ -64,13 +64,13 @@ func (p *PostgresParser) ProcessOutgoing(requestBuffer []byte, clientConn, destC case models.MODE_RECORD: err := encodePostgresOutgoing(requestBuffer, clientConn, destConn, p.hooks, p.logger, ctx) if err != nil { - p.logger.Error("failed to encode the outgoing postgres call", zap.Error(err)) + p.logger.Debug("failed to encode the outgoing postgres call", zap.Error(err)) } case models.MODE_TEST: logger := p.logger.With(zap.Any("Client IP Address", clientConn.RemoteAddr().String()), zap.Any("Client ConnectionID", util.GetNextID()), zap.Any("Destination ConnectionID", util.GetNextID())) err := decodePostgresOutgoing(requestBuffer, clientConn, destConn, p.hooks, logger, ctx) - if err != nil { - logger.Error("failed to decode the outgoing postgres call", zap.Error(err)) + if err != nil && !p.hooks.IsUserAppTerminateInitiated() { + logger.Debug("failed to decode the outgoing postgres call", zap.Error(err)) } default: p.logger.Info("Invalid mode detected while intercepting outgoing http call", zap.Any("mode", models.GetMode())) @@ -506,7 +506,7 @@ func decodePostgresOutgoing(requestBuffer []byte, clientConn, destConn net.Conn, logger.Debug("EOF error received from client. Closing connection in postgres !!") return err } - logger.Error("failed to read the request message in proxy for postgres dependency", zap.Error(err)) + logger.Debug("failed to read the request message in proxy for postgres dependency", zap.Error(err)) return err } }