You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2018/01/13 22:18:56 UTC
logging-log4j2 git commit: More debug logging.
Repository: logging-log4j2
Updated Branches:
refs/heads/master c3ca2560b -> 0a162cc8d
More debug logging.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/0a162cc8
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0a162cc8
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0a162cc8
Branch: refs/heads/master
Commit: 0a162cc8d940d379dae00661931c7de12327fd5b
Parents: c3ca256
Author: Gary Gregory <gg...@apache.org>
Authored: Sat Jan 13 15:18:52 2018 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Sat Jan 13 15:18:52 2018 -0700
----------------------------------------------------------------------
.../log4j/core/appender/db/jdbc/JdbcDatabaseManager.java | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0a162cc8/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
index a571491..2e86dab 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/JdbcDatabaseManager.java
@@ -85,6 +85,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
this.connection = this.connectionSource.getConnection();
final DatabaseMetaData metaData = this.connection.getMetaData();
this.isBatchSupported = metaData.supportsBatchUpdates();
+ logger().debug("Closing Connection {}", this.connection);
Closer.closeSilently(this.connection);
}
@@ -211,14 +212,17 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
try {
if (this.connection != null && !this.connection.isClosed()) {
if (this.isBatchSupported) {
+ logger().debug("Executing batch PreparedStatement {}", this.statement);
this.statement.executeBatch();
}
+ logger().debug("Committing Connection {}", this.connection);
this.connection.commit();
}
} catch (final SQLException e) {
throw new AppenderLoggingException("Failed to commit transaction logging event or flushing buffer.", e);
} finally {
try {
+ logger().debug("Closing PreparedStatement {}", this.statement);
Closer.close(this.statement);
} catch (final Exception e) {
logWarn("Failed to close SQL statement logging event or flushing buffer", e);
@@ -228,6 +232,7 @@ public final class JdbcDatabaseManager extends AbstractDatabaseManager {
}
try {
+ logger().debug("Closing Connection {}", this.connection);
Closer.close(this.connection);
} catch (final Exception e) {
logWarn("Failed to close database connection logging event or flushing buffer", e);