Skip to content

Commit e3cf50d

Browse files
Merge pull request #16 from awslabs/rajeiyer
Update logging in driver
2 parents bb21a53 + 00ca618 commit e3cf50d

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

integrationtest/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1717
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1818
<modelVersion>4.0.0</modelVersion>
19-
<version>1.0.1</version>
19+
<version>1.0.2</version>
2020

2121
<parent>
2222
<groupId>software.amazon.timestream</groupId>
2323
<artifactId>timestream</artifactId>
24-
<version>1.0.1</version>
24+
<version>1.0.2</version>
2525
</parent>
2626

2727
<artifactId>integrationtest</artifactId>

jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<groupId>software.amazon.timestream</groupId>
1919
<artifactId>amazon-timestream-jdbc</artifactId>
20-
<version>1.0.1</version>
20+
<version>1.0.2</version>
2121
<packaging>jar</packaging>
2222

2323
<distributionManagement>

jdbc/src/main/java/software/amazon/timestream/jdbc/TimestreamDataSource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public Connection getConnection() throws SQLException {
7474

7575
@Override
7676
public Connection getConnection(String accessKey, String secretKey) throws SQLException {
77-
LOGGER.fine("Instantiating a TimestreamConnection from TimestreamDataSource.");
77+
LOGGER.finer("Instantiating a TimestreamConnection from TimestreamDataSource.");
7878
return createTimestreamConnection(getProperties(accessKey, secretKey));
7979
}
8080

@@ -94,13 +94,13 @@ public PooledConnection getPooledConnection(String accessKey, String secretKey)
9494
while (!poolForCredentials.isEmpty() && (timestreamPooledConnection == null)) {
9595
final TimestreamConnection connection = poolForCredentials.remove(0);
9696
if (!connection.isClosed()) {
97-
LOGGER.info("Returning an open connection from the connection pool.");
97+
LOGGER.finer("Returning an open connection from the connection pool.");
9898
timestreamPooledConnection = createTimestreamPooledConnection(connection);
9999
}
100100
}
101101

102102
if (timestreamPooledConnection == null) {
103-
LOGGER.info("Could not find a connection in the pool, creating a connection.");
103+
LOGGER.finer("Could not find a connection in the pool, creating a connection.");
104104
timestreamPooledConnection = createTimestreamPooledConnection(
105105
createTimestreamConnection(getProperties(accessKey, secretKey)));
106106
}
@@ -680,9 +680,9 @@ public void connectionClosed(ConnectionEvent event) {
680680
eventSource.removeConnectionEventListener(this);
681681
final TimestreamConnection connection = (TimestreamConnection) eventSource.getConnection();
682682
if (connection.isClosed()) {
683-
LOGGER.info("Connection is closed, not recycling connection back into the connection pool.");
683+
LOGGER.finer("Connection is closed, not recycling connection back into the connection pool.");
684684
} else {
685-
LOGGER.info("Connection is still open, recycling the connection back into the connection pool.");
685+
LOGGER.finer("Connection is still open, recycling the connection back into the connection pool.");
686686
availablePools.get(connection.getConnectionProperties()).add(connection);
687687
}
688688
}

jdbc/src/main/java/software/amazon/timestream/jdbc/TimestreamDriver.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public class TimestreamDriver implements java.sql.Driver {
4949
SLF4JBridgeHandler.removeHandlersForRootLogger();
5050
SLF4JBridgeHandler.install();
5151

52-
// Enable all logs in the JUL Logger since we want to control things via SLF4J. JUL Logger will filter out
52+
// Enable only >= FINE logs in the JUL Logger since we want to control things via SLF4J. JUL Logger will filter out
5353
// messages before it gets to SLF4J if it set to a restrictive level.
5454
LOGGER.setLevel(Level.FINE);
5555

5656
APPLICATION_NAME = getApplicationName();
5757
APP_NAME_SUFFIX = " [" + APPLICATION_NAME + "]";
58-
LOGGER.fine("Name of the application using the driver: " + APP_NAME_SUFFIX);
58+
LOGGER.finer("Name of the application using the driver: " + APP_NAME_SUFFIX);
5959

6060
// Load the driver version from the associated pom file.
6161
int majorVersion = 0;
@@ -107,8 +107,8 @@ public TimestreamConnection connect(String url, Properties info) throws SQLExcep
107107
return null;
108108
}
109109

110-
LOGGER.info("Timestream JDBC driver version: " + DRIVER_VERSION);
111-
LOGGER.fine("Instantiating a TimestreamConnection from TimestreamDriver.");
110+
LOGGER.fine("Timestream JDBC driver version: " + DRIVER_VERSION);
111+
LOGGER.finer("Instantiating a TimestreamConnection from TimestreamDriver.");
112112
return createTimestreamConnection(parseUrl(url, info),
113113
new ClientConfiguration().withUserAgentSuffix(getUserAgentSuffix()));
114114
}
@@ -134,7 +134,7 @@ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws
134134
if (acceptsURL(url)) {
135135
tempUrl = url;
136136
} else {
137-
LOGGER.info("Unsupported input URL: \""
137+
LOGGER.warning("Unsupported input URL: \""
138138
+ url
139139
+ "\", the default URL \""
140140
+ Constants.URL_PREFIX
@@ -207,7 +207,7 @@ private static String getApplicationName() {
207207
}
208208
} catch (Exception err) {
209209
// Eat the exception and fall through.
210-
LOGGER.info(
210+
LOGGER.warning(
211211
"An exception has occurred and ignored while retrieving the caller application name: "
212212
+ err.getLocalizedMessage());
213213
}
@@ -256,7 +256,7 @@ private Properties parseUrl(String url, Properties info) throws SQLException {
256256
if (TimestreamConnectionProperty.isSupportedProperty(keyString)) {
257257
allProperties.put(keyString, value);
258258
} else {
259-
LOGGER.fine("Ignored unsupported property: " + keyString);
259+
LOGGER.warning("Ignored unsupported property: " + keyString);
260260
}
261261
});
262262
}
@@ -271,7 +271,7 @@ private Properties parseUrl(String url, Properties info) throws SQLException {
271271
if (TimestreamConnectionProperty.isSupportedProperty(trimmedKeyStr)) {
272272
allProperties.put(trimmedKeyStr, keyValue[1]);
273273
} else {
274-
LOGGER.fine("Ignored unsupported property: " + trimmedKeyStr);
274+
LOGGER.warning("Ignored unsupported property: " + trimmedKeyStr);
275275
}
276276
}
277277
}

performancetest/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>software.amazon.timestream</groupId>
2222
<artifactId>timestream</artifactId>
23-
<version>1.0.1</version>
23+
<version>1.0.2</version>
2424
</parent>
2525

2626
<artifactId>performancetest</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<groupId>software.amazon.timestream</groupId>
1919
<artifactId>timestream</artifactId>
20-
<version>1.0.1</version>
20+
<version>1.0.2</version>
2121
<packaging>pom</packaging>
2222

2323
<modules>

0 commit comments

Comments
 (0)