incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1514300 - in /sling/trunk/contrib/extensions/healthcheck: healthchecks/src/main/java/org/apache/sling/hc/healthchecks/impl/ webconsole/src/main/resources/res/ui/
Date Thu, 15 Aug 2013 14:35:25 GMT
Author: bdelacretaz
Date: Thu Aug 15 14:35:25 2013
New Revision: 1514300

URL: http://svn.apache.org/r1514300
Log:
SLING-3020 - error reporting tweaks

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/SlingRequestStatusHealthCheck.java
    sling/trunk/contrib/extensions/healthcheck/webconsole/src/main/resources/res/ui/healthcheck.css

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=1514300&r1=1514299&r2=1514300&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
Thu Aug 15 14:35:25 2013
@@ -94,11 +94,12 @@ public class JmxAttributeHealthCheck imp
             final MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
             final ObjectName objectName = new ObjectName(mbeanName);
             if(jmxServer.queryNames(objectName, null).size() == 0) {
-                log.error("MBean not found: {}", objectName);
+                resultLog.warn("MBean not found: {}", objectName);
+            } else {
+                final Object value = jmxServer.getAttribute(objectName, attributeName);
+                resultLog.debug("{} {} returns {}", mbeanName, attributeName, value);
+                new SimpleConstraintChecker().check(value, constraint, resultLog);
             }
-            final Object value = jmxServer.getAttribute(objectName, attributeName);
-            resultLog.debug("{} {} returns {}", mbeanName, attributeName, value);
-            new SimpleConstraintChecker().check(value, constraint, resultLog);
         } catch(Exception e) {
             log.warn("JMX attribute {}/{} check failed: {}", new Object []{ mbeanName, attributeName,
e});
             resultLog.healthCheckError("JMX attribute check failed: {}", e);

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=1514300&r1=1514299&r2=1514300&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
Thu Aug 15 14:35:25 2013
@@ -57,7 +57,7 @@ public class SlingRequestStatusHealthChe
         int status;
         String path;
         
-        PathSpec(String configuredPath) {
+        PathSpec(String configuredPath, FormattingResultLog resultLog) {
             path = configuredPath;
             status = 200;
             
@@ -67,7 +67,7 @@ public class SlingRequestStatusHealthChe
                     status = Integer.valueOf(parts[1].trim());
                     path = parts[0].trim();
                 } catch(NumberFormatException nfe) {
-                    log.warn("NumberFormatException while parsing [{}], invalid status value?",
configuredPath);
+                    resultLog.healthCheckError("NumberFormatException while parsing [{}],
invalid status value?", configuredPath);
                 }
             } 
         }
@@ -111,7 +111,7 @@ public class SlingRequestStatusHealthChe
             resolver = resolverFactory.getAdministrativeResourceResolver(null);
             for(String p : paths) {
                 lastPath = p;
-                final PathSpec ps = new PathSpec(p);
+                final PathSpec ps = new PathSpec(p, resultLog);
                 final HttpServletRequest request = new InternalRequest(ps.path);
                 final InternalResponse response = new InternalResponse();
                 requestProcessor.processRequest(request, response, resolver);

Modified: sling/trunk/contrib/extensions/healthcheck/webconsole/src/main/resources/res/ui/healthcheck.css
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/healthcheck/webconsole/src/main/resources/res/ui/healthcheck.css?rev=1514300&r1=1514299&r2=1514300&view=diff
==============================================================================
--- sling/trunk/contrib/extensions/healthcheck/webconsole/src/main/resources/res/ui/healthcheck.css
(original)
+++ sling/trunk/contrib/extensions/healthcheck/webconsole/src/main/resources/res/ui/healthcheck.css
Thu Aug 15 14:35:25 2013
@@ -24,8 +24,8 @@
 }
 
 .healthcheck .logWARN,
-.healthcheck .logSECURITY,
-.healthcheck .logCONFIG
+.healthcheck .logCRITICAL,
+.healthcheck .logHEALTH_CHECK_ERROR
 {
     color:red;
 }



Mime
View raw message