Skip to content

Commit dc42c7a

Browse files
committed
Added redirection logger
1 parent 28bad50 commit dc42c7a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/main/java/com/microsoft/sqlserver/jdbc/SQLServerConnection.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,8 @@ final SQLCollation getDatabaseCollation() {
15821582
.getLogger("com.microsoft.sqlserver.jdbc.Connection");
15831583
static final java.util.logging.Logger loggerResiliency = java.util.logging.Logger
15841584
.getLogger("com.microsoft.sqlserver.jdbc.Resiliency");
1585+
static final java.util.logging.Logger loggerRedirection = java.util.logging.Logger
1586+
.getLogger("com.microsoft.sqlserver.jdbc.Redirection");
15851587
private static String loggingClassNameBase = "com.microsoft.sqlserver.jdbc.SQLServerConnection";
15861588

15871589
/** Instance-specific loggingClassName to identity the connection in logs */
@@ -3107,8 +3109,8 @@ private void login(String primary, String primaryInstanceName, int primaryPortNu
31073109
currentConnectPlaceHolder = currentFOPlaceHolder;
31083110
} else {
31093111
if (routingInfo != null) {
3110-
if (loggerResiliency.isLoggable(Level.FINER)) {
3111-
loggerResiliency.finer(toString() + " Connection open - redirecting to server and instance: " + routingInfo.getFullServerName());
3112+
if (loggerRedirection.isLoggable(Level.FINE)) {
3113+
loggerRedirection.finer(toString() + " Connection open - redirecting to server and instance: " + routingInfo.getFullServerName());
31123114
}
31133115
currentPrimaryPlaceHolder = routingInfo;
31143116
routingInfo = null;
@@ -3152,8 +3154,8 @@ private void login(String primary, String primaryInstanceName, int primaryPortNu
31523154

31533155
noOfRedirections++;
31543156

3155-
if (loggerResiliency.isLoggable(Level.FINER)) {
3156-
loggerResiliency.finer(toString() + " Connection open - redirection count: " + noOfRedirections);
3157+
if (loggerRedirection.isLoggable(Level.FINE)) {
3158+
loggerRedirection.finer(toString() + " Connection open - redirection count: " + noOfRedirections);
31573159
}
31583160

31593161
if (noOfRedirections > 1) {

0 commit comments

Comments
 (0)