Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/AE.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ void add(byte[] encryptedKey, int dbId, int keyId, int keyVersion, byte[] mdVers

assert null != columnEncryptionKeyValues : "columnEncryptionKeyValues should already be initialized.";

aeLogger.fine("Retrieving CEK values");
if (aeLogger.isLoggable(java.util.logging.Level.FINE)) {
aeLogger.fine("Retrieving CEK values");
}

EncryptionKeyInfo encryptionKey = new EncryptionKeyInfo(encryptedKey, dbId, keyId, keyVersion, mdVersion,
keyPath, keyStoreName, algorithmName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

package com.microsoft.sqlserver.jdbc;

import java.util.logging.Level;


class FedAuthDllInfo {
byte[] accessTokenBytes = null;
long expiresIn = 0;
Expand Down Expand Up @@ -97,7 +100,9 @@ byte[] GenerateClientContext(byte[] pin, boolean[] done) throws SQLServerExcepti
null, null, authLogger);

if (failure != 0) {
authLogger.warning(toString() + " Authentication failed code : " + failure);
if (authLogger.isLoggable(Level.WARNING)) {
authLogger.warning(toString() + " Authentication failed code : " + failure);
}
con.terminate(SQLServerException.DRIVER_ERROR_NONE,
SQLServerException.getErrString("R_integratedAuthenticationFailed"), linkError);
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/microsoft/sqlserver/jdbc/DDC.java
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,8 @@ final class AsciiFilteredInputStream extends InputStream {
}

AsciiFilteredInputStream(BaseInputStream containedStream) throws SQLServerException {
BaseInputStream.logger.finer(containedStream.toString() + " wrapping in AsciiFilteredInputStream");
if (BaseInputStream.logger.isLoggable(java.util.logging.Level.FINER))
BaseInputStream.logger.finer(containedStream.toString() + " wrapping in AsciiFilteredInputStream");
this.containedStream = containedStream;
}

Expand Down Expand Up @@ -1264,7 +1265,8 @@ final class AsciiFilteredUnicodeInputStream extends InputStream {

static AsciiFilteredUnicodeInputStream MakeAsciiFilteredUnicodeInputStream(BaseInputStream strm,
Reader rd) throws SQLServerException {
BaseInputStream.logger.finer(strm.toString() + " wrapping in AsciiFilteredInputStream");
if (BaseInputStream.logger.isLoggable(java.util.logging.Level.FINER))
BaseInputStream.logger.finer(strm.toString() + " wrapping in AsciiFilteredInputStream");
return new AsciiFilteredUnicodeInputStream(rd);
}

Expand Down
15 changes: 10 additions & 5 deletions src/main/java/com/microsoft/sqlserver/jdbc/FailOverInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
package com.microsoft.sqlserver.jdbc;

import java.text.MessageFormat;
import java.util.logging.Level;


/**
* This class keeps the failover server info and if the mirror has become the primary. For synchronizing better and not
Expand Down Expand Up @@ -36,8 +38,9 @@ boolean getUseFailoverPartner() {

// the members of this class are not exposed so inorder to log we call this function.
void log(SQLServerConnection con) {
con.getConnectionLogger().fine(con.toString() + " Failover server :" + failoverPartner
+ " Failover partner is primary : " + useFailoverPartner);
if (con.getConnectionLogger().isLoggable(Level.FINE))
con.getConnectionLogger().fine(con.toString() + " Failover server :" + failoverPartner
+ " Failover partner is primary : " + useFailoverPartner);
}

// this function gets the failover server port and sets up the security manager
Expand All @@ -56,7 +59,8 @@ private void setupInfo(SQLServerConnection con) throws SQLServerException {

// found the instance name with the severname
if (px >= 0) {
con.getConnectionLogger().fine(con.toString() + " Failover server :" + failoverPartner);
if (con.getConnectionLogger().isLoggable(Level.FINE))
con.getConnectionLogger().fine(con.toString() + " Failover server :" + failoverPartner);
instanceValue = failoverPartner.substring(px + 1, failoverPartner.length());
failoverPartner = failoverPartner.substring(0, px);
con.ValidateMaxSQLLoginName(SQLServerDriverStringProperty.INSTANCE_NAME.toString(), instanceValue);
Expand Down Expand Up @@ -87,8 +91,9 @@ synchronized ServerPortPlaceHolder failoverPermissionCheck(SQLServerConnection c
synchronized void failoverAdd(SQLServerConnection connection, boolean actualUseFailoverPartner,
String actualFailoverPartner) throws SQLServerException {
if (useFailoverPartner != actualUseFailoverPartner) {
connection.getConnectionLogger()
.fine(connection.toString() + " Failover detected. failover partner=" + actualFailoverPartner);
if (connection.getConnectionLogger().isLoggable(Level.FINE))
connection.getConnectionLogger()
.fine(connection.toString() + " Failover detected. failover partner=" + actualFailoverPartner);
useFailoverPartner = actualUseFailoverPartner;
}
// The checking for actualUseFailoverPartner may look weird but this is required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ static FailoverInfo getFailoverInfo(SQLServerConnection connection, String prima
return null;
} else {
String mapKey = concatPrimaryDatabase(primaryServer, instance, database);
connection.getConnectionLogger()
.finer(connection.toString() + " Looking up info in the map using key: " + mapKey);
if (connection.getConnectionLogger().isLoggable(Level.FINER))
connection.getConnectionLogger()
.finer(connection.toString() + " Looking up info in the map using key: " + mapKey);
FailoverInfo fo = failoverMap.get(mapKey);
if (null != fo)
fo.log(connection);
Expand Down
Loading