diff --git a/src/main/java/net/snowflake/client/config/SFClientConfigParser.java b/src/main/java/net/snowflake/client/config/SFClientConfigParser.java index 45b38dbfa..9d93aed0a 100644 --- a/src/main/java/net/snowflake/client/config/SFClientConfigParser.java +++ b/src/main/java/net/snowflake/client/config/SFClientConfigParser.java @@ -73,7 +73,7 @@ public static SFClientConfig loadSFClientConfig(String configFilePath) throws IO File configFile = new File(derivedConfigFilePath); ObjectMapper objectMapper = new ObjectMapper(); SFClientConfig clientConfig = objectMapper.readValue(configFile, SFClientConfig.class); - logger.info( + logger.debug( "Reading values logLevel {} and logPath {} from client configuration", clientConfig.getCommonProps().getLogLevel(), clientConfig.getCommonProps().getLogPath()); diff --git a/src/main/java/net/snowflake/client/core/CredentialManager.java b/src/main/java/net/snowflake/client/core/CredentialManager.java index 08e9e6b9a..691430edd 100644 --- a/src/main/java/net/snowflake/client/core/CredentialManager.java +++ b/src/main/java/net/snowflake/client/core/CredentialManager.java @@ -32,9 +32,7 @@ private void initSecureStorageManager() { logger.error("Unsupported Operating System. Expected: OSX, Windows, Linux", false); } } catch (NoClassDefFoundError error) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); } } @@ -97,9 +95,7 @@ void fillCachedMfaToken(SFLoginInput loginInput) throws SFException { synchronized void fillCachedCredential(SFLoginInput loginInput, String credType) throws SFException { if (secureStorageManager == null) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); return; } @@ -109,9 +105,7 @@ synchronized void fillCachedCredential(SFLoginInput loginInput, String credType) secureStorageManager.getCredential( loginInput.getHostFromServerUrl(), loginInput.getUserName(), credType); } catch (NoClassDefFoundError error) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); return; } @@ -183,9 +177,7 @@ synchronized void writeTemporaryCredential(SFLoginInput loginInput, String cred, } if (secureStorageManager == null) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); return; } @@ -193,9 +185,7 @@ synchronized void writeTemporaryCredential(SFLoginInput loginInput, String cred, secureStorageManager.setCredential( loginInput.getHostFromServerUrl(), loginInput.getUserName(), credType, cred); } catch (NoClassDefFoundError error) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); } } @@ -222,18 +212,20 @@ void deleteMfaTokenCache(String host, String user) { */ synchronized void deleteTemporaryCredential(String host, String user, String credType) { if (secureStorageManager == null) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); return; } try { secureStorageManager.deleteCredential(host, user, credType); } catch (NoClassDefFoundError error) { - logger.info( - "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", - false); + logMissingJnaJarForSecureLocalStorage(); } } + + private static void logMissingJnaJarForSecureLocalStorage() { + logger.warn( + "JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.", + false); + } } diff --git a/src/main/java/net/snowflake/client/core/FileCacheManager.java b/src/main/java/net/snowflake/client/core/FileCacheManager.java index 328aecc9c..05972b620 100644 --- a/src/main/java/net/snowflake/client/core/FileCacheManager.java +++ b/src/main/java/net/snowflake/client/core/FileCacheManager.java @@ -165,7 +165,7 @@ FileCacheManager build() { this.cacheLockFile = new File(this.cacheFile.getParentFile(), this.baseCacheFileName + ".lck"); } catch (IOException | SecurityException ex) { - logger.info("Failed to touch the cache file. Ignored. {}", cacheFileTmp.getAbsoluteFile()); + logger.debug("Failed to touch the cache file. Ignored. {}", cacheFileTmp.getAbsoluteFile()); } return this; } diff --git a/src/main/java/net/snowflake/client/core/IncidentUtil.java b/src/main/java/net/snowflake/client/core/IncidentUtil.java index 0506f159b..41d31c5cd 100644 --- a/src/main/java/net/snowflake/client/core/IncidentUtil.java +++ b/src/main/java/net/snowflake/client/core/IncidentUtil.java @@ -206,7 +206,7 @@ private static void writeVmMetrics(JsonGenerator json, VirtualMachineMetrics vm) // This function can throw an error with java 11. json.writeNumberField("fd_usage", vm.fileDescriptorUsage()); } catch (Exception e) { - logger.info("Error writing fd_usage", e); + logger.debug("Error writing fd_usage", e); } json.writeFieldName("thread-states"); diff --git a/src/main/java/net/snowflake/client/core/SFBaseSession.java b/src/main/java/net/snowflake/client/core/SFBaseSession.java index 9222b4a57..a7b374fde 100644 --- a/src/main/java/net/snowflake/client/core/SFBaseSession.java +++ b/src/main/java/net/snowflake/client/core/SFBaseSession.java @@ -687,7 +687,7 @@ private void logHttpClientInitInfo(HttpClientSettingsKey key) { key.getProxyUser(), key.getProxyPassword().isEmpty() ? "not set" : "set"); } else { - logger.info( + logger.debug( "Driver OCSP mode: {}, gzip disabled: {} and no proxy", key.getOcspMode(), key.getGzipDisabled()); diff --git a/src/main/java/net/snowflake/client/core/SFSession.java b/src/main/java/net/snowflake/client/core/SFSession.java index d26da7828..5e583de30 100644 --- a/src/main/java/net/snowflake/client/core/SFSession.java +++ b/src/main/java/net/snowflake/client/core/SFSession.java @@ -794,7 +794,7 @@ public synchronized void open() throws SFException, SnowflakeSQLException { // start heartbeat for this session so that the master token will not expire startHeartbeatForThisSession(); stopwatch.stop(); - logger.info("Session {} opened in {} ms.", getSessionId(), stopwatch.elapsedMillis()); + logger.debug("Session {} opened in {} ms.", getSessionId(), stopwatch.elapsedMillis()); } /** @@ -937,7 +937,7 @@ public void close() throws SFException, SnowflakeSQLException { } stopwatch.stop(); - logger.info( + logger.debug( "Session {} has been successfully closed in {} ms", getSessionId(), stopwatch.elapsedMillis()); diff --git a/src/main/java/net/snowflake/client/core/SFStatement.java b/src/main/java/net/snowflake/client/core/SFStatement.java index 173ecf21f..0d0668e27 100644 --- a/src/main/java/net/snowflake/client/core/SFStatement.java +++ b/src/main/java/net/snowflake/client/core/SFStatement.java @@ -435,11 +435,11 @@ public Object executeHelper( } if (numBinds > 0 && session.getPreparedStatementLogging()) { if (numBinds > MAX_BINDING_PARAMS_FOR_LOGGING) { - logger.info( + logger.debug( "Number of binds exceeds logging limit. Printing off {} binding parameters.", MAX_BINDING_PARAMS_FOR_LOGGING); } else { - logger.info("Printing off {} binding parameters.", numBinds); + logger.debug("Printing off {} binding parameters.", numBinds); } int counter = 0; // if it's an array bind, print off the first few rows from each column. @@ -458,7 +458,7 @@ public Object executeHelper( rows += bindRows.get(i) + ", "; } rows += "]"; - logger.info("Column {}: {}", entry.getKey(), rows); + logger.debug("Column {}: {}", entry.getKey(), rows); counter += numRowsPrinted; if (counter >= MAX_BINDING_PARAMS_FOR_LOGGING) { break; @@ -472,7 +472,7 @@ public Object executeHelper( break; } counter++; - logger.info("Column {}: {}", entry.getKey(), entry.getValue().getValue()); + logger.debug("Column {}: {}", entry.getKey(), entry.getValue().getValue()); } } } diff --git a/src/main/java/net/snowflake/client/core/SecureStorageAppleManager.java b/src/main/java/net/snowflake/client/core/SecureStorageAppleManager.java index 5030e4603..fb467edcc 100644 --- a/src/main/java/net/snowflake/client/core/SecureStorageAppleManager.java +++ b/src/main/java/net/snowflake/client/core/SecureStorageAppleManager.java @@ -22,13 +22,13 @@ private SecureStorageAppleManager() { } public static SecureStorageAppleManager builder() { - logger.info("Using Apple Keychain as a token cache storage"); + logger.debug("Using Apple Keychain as a token cache storage"); return new SecureStorageAppleManager(); } public SecureStorageStatus setCredential(String host, String user, String type, String cred) { if (Strings.isNullOrEmpty(cred)) { - logger.info("No credential provided", false); + logger.debug("No credential provided", false); return SecureStorageStatus.SUCCESS; } @@ -53,7 +53,7 @@ public SecureStorageStatus setCredential(String host, String user, String type, } if (errCode != SecurityLib.ERR_SEC_SUCCESS && errCode != SecurityLib.ERR_SEC_ITEM_NOT_FOUND) { - logger.info( + logger.warn( String.format( "Failed to check the existence of the item in keychain. Error code = %d", Native.getLastError())); @@ -81,7 +81,7 @@ public SecureStorageStatus setCredential(String host, String user, String type, } if (errCode != SecurityLib.ERR_SEC_SUCCESS) { - logger.info( + logger.warn( String.format( "Failed to set/modify the item in keychain. Error code = %d", Native.getLastError())); return SecureStorageStatus.FAILURE; @@ -115,14 +115,14 @@ public String getCredential(String host, String user, String type) { } if (errCode != SecurityLib.ERR_SEC_SUCCESS) { - logger.info( + logger.warn( String.format( "Failed to find the item in keychain or item not exists. Error code = %d", Native.getLastError())); return null; } if (dataLength[0] == 0 || data[0] == null) { - logger.info("Found empty item or no item is found", false); + logger.warn("Found empty item or no item is found", false); return null; } @@ -162,7 +162,7 @@ public SecureStorageStatus deleteCredential(String host, String user, String typ } if (errCode != SecurityLib.ERR_SEC_SUCCESS && errCode != SecurityLib.ERR_SEC_ITEM_NOT_FOUND) { - logger.info( + logger.warn( String.format( "Failed to delete the item in keychain. Error code = %d", Native.getLastError())); return SecureStorageStatus.FAILURE; @@ -174,7 +174,7 @@ public SecureStorageStatus deleteCredential(String host, String user, String typ } if (errCode != SecurityLib.ERR_SEC_SUCCESS) { - logger.info( + logger.warn( String.format( "Failed to delete the item in keychain. Error code = %d", Native.getLastError())); return SecureStorageStatus.FAILURE; diff --git a/src/main/java/net/snowflake/client/core/SecureStorageLinuxManager.java b/src/main/java/net/snowflake/client/core/SecureStorageLinuxManager.java index 7663147b3..d8c44dda3 100644 --- a/src/main/java/net/snowflake/client/core/SecureStorageLinuxManager.java +++ b/src/main/java/net/snowflake/client/core/SecureStorageLinuxManager.java @@ -41,7 +41,7 @@ private SecureStorageLinuxManager() { .setCacheExpirationInSeconds(CACHE_EXPIRATION_IN_SECONDS) .setCacheFileLockExpirationInSeconds(CACHE_FILE_LOCK_EXPIRATION_IN_SECONDS) .build(); - logger.info( + logger.debug( "Using temporary file: {} as a token cache storage", fileCacheManager.getCacheFilePath()); } @@ -70,7 +70,7 @@ private ObjectNode localCacheToJson() { public synchronized SecureStorageStatus setCredential( String host, String user, String type, String token) { if (Strings.isNullOrEmpty(token)) { - logger.info("No token provided", false); + logger.warn("No token provided", false); return SecureStorageStatus.SUCCESS; } diff --git a/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java b/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java index f38c1570b..e47a6d88b 100644 --- a/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java +++ b/src/main/java/net/snowflake/client/core/SecureStorageWindowsManager.java @@ -33,13 +33,13 @@ private SecureStorageWindowsManager() { } public static SecureStorageWindowsManager builder() { - logger.info("Using Windows Credential Manager as a token cache storage"); + logger.debug("Using Windows Credential Manager as a token cache storage"); return new SecureStorageWindowsManager(); } public SecureStorageStatus setCredential(String host, String user, String type, String token) { if (Strings.isNullOrEmpty(token)) { - logger.info("No token provided", false); + logger.warn("No token provided", false); return SecureStorageStatus.SUCCESS; } @@ -63,13 +63,13 @@ public SecureStorageStatus setCredential(String host, String user, String type, } if (!ret) { - logger.info( + logger.warn( String.format( "Failed to write to Windows Credential Manager. Error code = %d", Native.getLastError())); return SecureStorageStatus.FAILURE; } - logger.info("Wrote to Windows Credential Manager successfully", false); + logger.debug("Wrote to Windows Credential Manager successfully", false); return SecureStorageStatus.SUCCESS; } @@ -90,7 +90,7 @@ public String getCredential(String host, String user, String type) { } if (!ret) { - logger.info( + logger.warn( String.format( "Failed to read target or could not find it in Windows Credential Manager. Error code = %d", Native.getLastError())); @@ -104,12 +104,12 @@ public String getCredential(String host, String user, String type) { if (SecureStorageWindowsCredentialType.typeOf(cred.Type) != SecureStorageWindowsCredentialType.CRED_TYPE_GENERIC) { - logger.info("Wrong type of credential. Expected: CRED_TYPE_GENERIC", false); + logger.warn("Wrong type of credential. Expected: CRED_TYPE_GENERIC", false); return null; } if (cred.CredentialBlobSize == 0) { - logger.info("Returned credential is empty", false); + logger.debug("Returned credential is empty", false); return null; } @@ -137,7 +137,7 @@ public SecureStorageStatus deleteCredential(String host, String user, String typ } if (!ret) { - logger.info( + logger.warn( String.format( "Failed to delete target in Windows Credential Manager. Error code = %d", Native.getLastError())); diff --git a/src/main/java/net/snowflake/client/core/SystemUtil.java b/src/main/java/net/snowflake/client/core/SystemUtil.java index 1094261eb..721d83151 100644 --- a/src/main/java/net/snowflake/client/core/SystemUtil.java +++ b/src/main/java/net/snowflake/client/core/SystemUtil.java @@ -26,7 +26,7 @@ static int convertSystemPropertyToIntValue(String systemProperty, int defaultVal try { returnVal = Integer.parseInt(systemPropertyValue); } catch (NumberFormatException ex) { - logger.info( + logger.warn( "Failed to parse the system parameter {} with value {}", systemProperty, systemPropertyValue); diff --git a/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java b/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java index 67151bea8..ee9d5f307 100644 --- a/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java +++ b/src/main/java/net/snowflake/client/jdbc/DefaultSFConnectionHandler.java @@ -189,7 +189,7 @@ && systemGetProperty("java.util.logging.config.file") == null) { if (logLevel != null && logPattern != null) { try { - logger.info("Setting logger with log level {} and log pattern {}", logLevel, logPattern); + logger.debug("Setting logger with log level {} and log pattern {}", logLevel, logPattern); JDK14Logger.instantiateLogger(logLevel, logPattern); } catch (IOException ex) { throw new SnowflakeSQLLoggedException( @@ -325,7 +325,7 @@ private void initSessionProperties(SnowflakeConnectString conStr, String appID, properties.replace(property.getKey(), "900"); } } catch (NumberFormatException ex) { - logger.info( + logger.warn( "Invalid data type for CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY: {}", property.getValue()); continue; diff --git a/src/main/java/net/snowflake/client/jdbc/FileBackedOutputStream.java b/src/main/java/net/snowflake/client/jdbc/FileBackedOutputStream.java index 14fb7dbdc..d1de7bfb9 100644 --- a/src/main/java/net/snowflake/client/jdbc/FileBackedOutputStream.java +++ b/src/main/java/net/snowflake/client/jdbc/FileBackedOutputStream.java @@ -27,6 +27,8 @@ import java.io.InputStream; import java.io.OutputStream; import net.snowflake.client.core.FileUtil; +import net.snowflake.client.log.SFLogger; +import net.snowflake.client.log.SFLoggerFactory; /** * An {@link OutputStream} that starts buffering to a byte array, but switches to file buffering @@ -42,6 +44,8 @@ @Beta public final class FileBackedOutputStream extends OutputStream { + private static final SFLogger logger = SFLoggerFactory.getLogger(FileBackedOutputStream.class); + private final int fileThreshold; private final boolean resetOnFinalize; private final ByteSource source; @@ -105,7 +109,7 @@ protected void finalize() { try { reset(); } catch (Throwable t) { - t.printStackTrace(System.err); + logger.error("Exception occurred on finalize", t); } } }; diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeCallableStatementV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeCallableStatementV1.java index 930e70039..7bc3f87d5 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeCallableStatementV1.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeCallableStatementV1.java @@ -65,7 +65,7 @@ final class SnowflakeCallableStatementV1 extends SnowflakePreparedStatementV1 static String parseSqlEscapeSyntax(String originalSql) { originalSql = originalSql.trim(); if (originalSql.startsWith("{") && originalSql.endsWith("}")) { - logger.info("Curly brackets {} removed before sending sql to server.", false); + logger.debug("Curly brackets {} removed before sending sql to server.", false); return originalSql.substring(1, originalSql.length() - 1); } return originalSql; diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java index fe1880083..674606f3a 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeChunkDownloader.java @@ -842,7 +842,7 @@ public DownloaderMetrics terminate() throws InterruptedException { chunks.stream().reduce(0L, (acc, chunk) -> acc + chunk.getRowCount(), Long::sum); long chunksSize = chunks.size(); - logger.info( + logger.debug( "Completed processing {} {} chunks for query {} in {} ms. Download took {} ms (average: {} ms)," + " parsing took {} ms (average: {} ms). Chunks uncompressed size: {} MB (average: {} MB)," + " rows in chunks: {} (total: {}, average in chunk: {}), total memory used: {} MB", @@ -1034,7 +1034,7 @@ public Void call() { "Thread {} finish downloading chunk#{}", Thread.currentThread().getId(), chunkIndex); downloader.downloaderFutures.remove(chunkIndex); if (chunkIndex % 5 == 0) { - logger.info( + logger.debug( "Processed {} chunk#{} in {} ms ({} out of {}) for query {}. Download took {} ms, " + "parsing took {} ms. Chunk uncompressed size: {} kB, cols: {}, rows: {}, scrubbed URL: {}", downloader.queryResultFormat == QueryResultFormat.ARROW ? "ARROW" : "JSON", @@ -1050,7 +1050,7 @@ public Void call() { resultChunk.rowCount, resultChunk.getScrubbedUrl()); } else { - logger.debug( + logger.trace( "Processed {} chunk#{} in {} ms ({} out of {}) for query {}. Download took {} ms, " + "parsing took {} ms. Chunk uncompressed size: {} kB, cols: {}, rows: {}, scrubbed URL: {}", downloader.queryResultFormat == QueryResultFormat.ARROW ? "ARROW" : "JSON", diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java index e918edf50..440ed14f7 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectString.java @@ -106,7 +106,7 @@ public static SnowflakeConnectString parse(String url, Properties info) { } parameters.put(k.toUpperCase(Locale.US), v); } catch (UnsupportedEncodingException ex0) { - logger.info("Failed to decode a parameter {}. Ignored.", p); + logger.warn("Failed to decode a parameter {}. Ignored.", p); } } } @@ -216,7 +216,7 @@ public String toString(boolean maskSensitiveValue) { urlStr.append(v); } } catch (UnsupportedEncodingException ex) { - logger.info("Failed to encode a parameter {}. Ignored.", entry.getKey()); + logger.warn("Failed to encode a parameter {}. Ignored.", entry.getKey()); } ++cnt; } diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java index 1f55c83f4..23ce7d2ef 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeConnectionV1.java @@ -145,14 +145,14 @@ private void initConnectionWithImpl( SFConnectionHandler sfConnectionHandler, String url, Properties info) throws SQLException { Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); - logger.info("Initializing new connection"); + logger.debug("Initializing new connection"); this.sfConnectionHandler = sfConnectionHandler; sfConnectionHandler.initializeConnection(url, info); this.sfSession = sfConnectionHandler.getSFSession(); missingProperties = sfSession.checkProperties(); this.showStatementParameters = sfSession.getPreparedStatementLogging(); stopwatch.stop(); - logger.info( + logger.debug( "Connection initialized successfully in {} ms. Session id: {}", stopwatch.elapsedMillis(), sfSession.getSessionId()); @@ -240,7 +240,7 @@ public void close() throws SQLException { if (sfSession != null) { sessionId = sfSession.getSessionId(); - logger.info("Closing connection with session id: {}", sessionId); + logger.debug("Closing connection with session id: {}", sessionId); } else { logger.debug("Closing connection without associated session"); } @@ -280,7 +280,7 @@ public void close() throws SQLException { sfSession, ex.getSqlState(), ex.getVendorCode(), ex.getCause(), ex.getParams()); } stopwatch.stop(); - logger.info( + logger.debug( "Connection with session id: {} closed successfully in {} ms", sessionId, stopwatch.elapsedMillis()); diff --git a/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java b/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java index 8e9a683a0..fbfa84676 100644 --- a/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java +++ b/src/main/java/net/snowflake/client/jdbc/SnowflakeUtil.java @@ -700,7 +700,6 @@ public static void systemSetEnv(String key, String value) { writableEnvForGet.put(key, value); } } catch (Exception e) { - System.out.println("Failed to set value"); logger.error( "Failed to set environment variable {}. Exception raised: {}", key, e.getMessage()); } @@ -720,7 +719,6 @@ public static void systemUnsetEnv(String key) { Map writableEnv = (Map) field.get(env); writableEnv.remove(key); } catch (Exception e) { - System.out.println("Failed to unset value"); logger.error( "Failed to remove environment variable {}. Exception raised: {}", key, e.getMessage()); } diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java index 0f8014ef6..6e57d3965 100644 --- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java +++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeAzureClient.java @@ -94,7 +94,7 @@ private SnowflakeAzureClient() {} public static SnowflakeAzureClient createSnowflakeAzureClient( StageInfo stage, RemoteStoreFileEncryptionMaterial encMat, SFBaseSession sfSession) throws SnowflakeSQLException { - logger.info( + logger.debug( "Initializing Snowflake Azure client with encryption: {}", encMat != null ? "true" : "false"); SnowflakeAzureClient azureClient = new SnowflakeAzureClient(); @@ -330,7 +330,7 @@ public void download( Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); String localFilePath = localLocation + localFileSep + destFileName; - logger.info( + logger.debug( "Staring download of file from Azure stage path: {} to {}", stageFilePath, localFilePath); int retryCount = 0; do { @@ -435,7 +435,7 @@ public InputStream downloadToStream( String presignedUrl, String queryId) throws SnowflakeSQLException { - logger.info( + logger.debug( "Staring download of file from Azure stage path: {} to input stream", stageFilePath); Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java index d6bf6ba84..ccf76388d 100644 --- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java +++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeGCSClient.java @@ -259,7 +259,7 @@ public void download( String queryId) throws SnowflakeSQLException { String localFilePath = localLocation + localFileSep + destFileName; - logger.info( + logger.debug( "Staring download of file from GCS stage path: {} to {}", stageFilePath, localFilePath); int retryCount = 0; Stopwatch stopwatch = new Stopwatch(); @@ -453,7 +453,7 @@ public InputStream downloadToStream( String presignedUrl, String queryId) throws SnowflakeSQLException { - logger.info("Staring download of file from GCS stage path: {} to input stream", stageFilePath); + logger.debug("Staring download of file from GCS stage path: {} to input stream", stageFilePath); int retryCount = 0; Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); diff --git a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java index f1a2392bb..19b08acf2 100644 --- a/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java +++ b/src/main/java/net/snowflake/client/jdbc/cloud/storage/SnowflakeS3Client.java @@ -352,7 +352,7 @@ public void download( Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); String localFilePath = localLocation + localFileSep + destFileName; - logger.info( + logger.debug( "Staring download of file from S3 stage path: {} to {}", stageFilePath, localFilePath); TransferManager tx = null; int retryCount = 0; @@ -473,7 +473,7 @@ public InputStream downloadToStream( String presignedUrl, String queryId) throws SnowflakeSQLException { - logger.info("Staring download of file from S3 stage path: {} to input stream", stageFilePath); + logger.debug("Staring download of file from S3 stage path: {} to input stream", stageFilePath); Stopwatch stopwatch = new Stopwatch(); stopwatch.start(); int retryCount = 0;