aurora-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zma...@apache.org
Subject aurora git commit: Enable H2 logging to slf4j.
Date Wed, 27 Jan 2016 21:52:16 GMT
Repository: aurora
Updated Branches:
  refs/heads/master e2a973e1e -> c417f9d09


Enable H2 logging to slf4j.

On a test cluster with DbTaskStore enabled there are several lines in the log
that look like:
````
2016-01-26 13:07:14 jdbc[15]: exception
````
There is no other information with these lines. This is a result of setting
`TRACE_LEVEL_SYSTEM_OUT` to `1` for H2. This will print out the error message
but not the associated throwable:
https://github.com/h2database/h2database/blob/a932268843ac84c7a665e427167ff2eb291d6b8e/h2/src/main/org/h2/message/TraceSystem.java#L228

The SLF4J implementation of tracing in H2 does not suffer from this restriction.

Reviewed at https://reviews.apache.org/r/42845/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/c417f9d0
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/c417f9d0
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/c417f9d0

Branch: refs/heads/master
Commit: c417f9d099299c06d02f5f2214a69966ebbab716
Parents: e2a973e
Author: Zameer Manji <zmanji@apache.org>
Authored: Wed Jan 27 13:52:02 2016 -0800
Committer: Zameer Manji <zmanji@apache.org>
Committed: Wed Jan 27 13:52:02 2016 -0800

----------------------------------------------------------------------
 .../org/apache/aurora/scheduler/storage/db/DbModule.java     | 8 +++-----
 src/main/resources/logback.xml                               | 6 +++++-
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/c417f9d0/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
index 36c462a..8b8c54a 100644
--- a/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/storage/db/DbModule.java
@@ -115,11 +115,9 @@ public final class DbModule extends PrivateModule {
         // READ COMMITTED transaction isolation.  More details here
         // http://www.h2database.com/html/advanced.html?#transaction_isolation
         .put("LOCK_MODE", "3")
-        // Error-level reporting for H2.
-        // See http://www.h2database.com/html/features.html#trace_options
-        // TODO(wfarner): H2 can ship these to slf4j, but is too noisy at our default level
(info).
-        // Use this logging and reduce the default level for h2's logger.
-        .put("TRACE_LEVEL_SYSTEM_OUT", "1")
+        // Send log messages from H2 to SLF4j
+        // See http://www.h2database.com/html/features.html#other_logging
+        .put("TRACE_LEVEL_FILE", "4")
         // Enable Query Statistics
         .put("QUERY_STATISTICS", "TRUE")
         .build();

http://git-wip-us.apache.org/repos/asf/aurora/blob/c417f9d0/src/main/resources/logback.xml
----------------------------------------------------------------------
diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml
index faf0dbc..84c175c 100644
--- a/src/main/resources/logback.xml
+++ b/src/main/resources/logback.xml
@@ -18,7 +18,7 @@ limitations under the License.
  to provide a reasonable default, but allow users to override in any format they wish.
  http://logback.qos.ch/manual/configuration.html
 -->
-<configuration>
+<configuration debug="true">
   <appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
     <target>System.err</target>
     <encoder>
@@ -27,6 +27,10 @@ limitations under the License.
       </pattern>
     </encoder>
   </appender>
+
+  <logger name="h2database" level="warn">
+  </logger>
+
   <root level="info">
     <appender-ref ref="STDERR" />
   </root>


Mime
View raw message