Skip to content

Commit d2b3a99

Browse files
committed
Reduce log level for receiving an Error payload.
This may not ultimately be an error for the consumer, so logging it as an Error is unnecessary. Reduce the log level to Debug since this would primarily be needed to troubleshoot the behaviour of this library.
1 parent ee2667e commit d2b3a99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,9 @@ private byte[] CreateConnectionAttributes(string programName)
13401340
private Exception CreateExceptionForErrorPayload(ReadOnlySpan<byte> span)
13411341
{
13421342
var errorPayload = ErrorPayload.Create(span);
1343-
var exception = errorPayload.ToException();
1344-
Log.Error(exception, "Session{0} got error payload: Code={1}, State={2}, Message={3}", m_logArguments[0], errorPayload.ErrorCode, errorPayload.State, errorPayload.Message);
1345-
return exception;
1343+
if (Log.IsDebugEnabled())
1344+
Log.Debug("Session{0} got error payload: Code={1}, State={2}, Message={3}", m_logArguments[0], errorPayload.ErrorCode, errorPayload.State, errorPayload.Message);
1345+
return errorPayload.ToException();
13461346
}
13471347

13481348
private void ClearPreparedStatements()

0 commit comments

Comments
 (0)