incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1513462 - in /sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl: JmxAttributeHealthCheck.java JmxScriptBinding.java OsgiScriptBinding.java SlingRequestStatusHealthCheck.java
Date Tue, 13 Aug 2013 12:44:23 GMT
Author: bdelacretaz
Date: Tue Aug 13 12:44:23 2013
New Revision: 1513462

URL: http://svn.apache.org/r1513462
Log:
SLING-2987 - fix logging errors

Modified:
    sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxAttributeHealthCheck.java
    sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxScriptBinding.java
    sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/OsgiScriptBinding.java
    sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/SlingRequestStatusHealthCheck.java

Modified: sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxAttributeHealthCheck.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxAttributeHealthCheck.java?rev=1513462&r1=1513461&r2=1513462&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxAttributeHealthCheck.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxAttributeHealthCheck.java
Tue Aug 13 12:44:23 2013
@@ -91,7 +91,7 @@ public class JmxAttributeHealthCheck imp
     public Result execute() {
         final Result result = new Result(log);
         result.log(ResultLogEntry.LT_DEBUG, 
-                MessageFormatter.format("Checking {} / {} with constraint {}", 
+                MessageFormatter.arrayFormat("Checking {} / {} with constraint {}", 
                         new Object[] { mbeanName, attributeName, constraint }).getMessage());
         try {
             final MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
@@ -100,7 +100,10 @@ public class JmxAttributeHealthCheck imp
                 log.error("MBean not found: {}", objectName);
             }
             final Object value = jmxServer.getAttribute(objectName, attributeName);
-            log.debug("{} {} returns {}", new Object[] { mbeanName, attributeName, value
});
+            result.log(ResultLogEntry.LT_DEBUG,
+                    MessageFormatter.arrayFormat( 
+                    "{} {} returns {}", 
+                    new Object[] { mbeanName, attributeName, value }).getMessage());
             new SimpleConstraintChecker().check(value, constraint, result);
         } catch(Exception e) {
             log.warn(e.toString(), e);

Modified: sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxScriptBinding.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxScriptBinding.java?rev=1513462&r1=1513461&r2=1513462&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxScriptBinding.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/JmxScriptBinding.java
Tue Aug 13 12:44:23 2013
@@ -54,7 +54,7 @@ public class JmxScriptBinding {
         result.log(ResultLogEntry.LT_DEBUG, MessageFormatter.format("Got JMX Object [{}]",
name).getMessage());
         final Object value = jmxServer.getAttribute(name, attributeName);
         result.log(ResultLogEntry.LT_DEBUG, 
-                MessageFormatter.format(
+                MessageFormatter.arrayFormat(
                         "JMX Object [{}] Attribute [{}] = [{}]", 
                         new Object[] { name, attributeName, value }).getMessage());
         return value;

Modified: sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/OsgiScriptBinding.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/OsgiScriptBinding.java?rev=1513462&r1=1513461&r2=1513462&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/OsgiScriptBinding.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/OsgiScriptBinding.java
Tue Aug 13 12:44:23 2013
@@ -53,7 +53,7 @@ public class OsgiScriptBinding {
         if(!isFragment(b) && Bundle.ACTIVE != b.getState()) {
             active = false;
             result.log(ResultLogEntry.LT_INFO, 
-                    MessageFormatter.format(
+                    MessageFormatter.arrayFormat(
                             "Bundle {} is not active, state={} ({})", 
                             new Object[] { b.getSymbolicName(), b.getState(), b.getState()}).getMessage());
         }

Modified: sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/SlingRequestStatusHealthCheck.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/SlingRequestStatusHealthCheck.java?rev=1513462&r1=1513461&r2=1513462&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/SlingRequestStatusHealthCheck.java
(original)
+++ sling/trunk/contrib/extensions/healthcheck/healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/SlingRequestStatusHealthCheck.java
Tue Aug 13 12:44:23 2013
@@ -118,7 +118,7 @@ public class SlingRequestStatusHealthChe
                 if(status != ps.status) {
                     failed++;
                     result.log(ResultLogEntry.LT_WARN,
-                            MessageFormatter.format(
+                            MessageFormatter.arrayFormat(
                             "[{}] returns status {}, expected {}", new Object[] { ps.path,
status, ps.status }).getMessage());
                 } else {
                     result.log(ResultLogEntry.LT_DEBUG,



Mime
View raw message