Skip to content

Commit b90a453

Browse files
authored
fix(logging): prevent excessive MySQL warning logs (#312)
Lower MySQL warning log level from INFO to DEBUG to reduce log spam while maintaining debugging visibility. Closes #311
1 parent 3e76ca7 commit b90a453

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/client/ReactorNettyClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,17 +379,17 @@ public void error(Throwable e) {
379379

380380
@Override
381381
public void next(ServerMessage message) {
382-
if (message instanceof WarningMessage) {
383-
int warnings = ((WarningMessage) message).getWarnings();
384-
if (warnings == 0) {
385-
if (DEBUG_ENABLED) {
382+
if (DEBUG_ENABLED) {
383+
if (message instanceof WarningMessage) {
384+
final int warnings = ((WarningMessage) message).getWarnings();
385+
if (warnings == 0) {
386386
logger.debug("Response: {}", message);
387+
} else {
388+
logger.debug("Response: {}, reports {} warning(s)", message, warnings);
387389
}
388-
} else if (INFO_ENABLED) {
389-
logger.info("Response: {}, reports {} warning(s)", message, warnings);
390+
} else {
391+
logger.debug("Response: {}", message);
390392
}
391-
} else if (DEBUG_ENABLED) {
392-
logger.debug("Response: {}", message);
393393
}
394394

395395
responseProcessor.emitNext(message, EmitFailureHandler.FAIL_FAST);

0 commit comments

Comments
 (0)