SLING-6178 : lowering log.error when discovery is not available to debug and showing this information more prominently in the webconsole under status-slingscheduler instead
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1765827 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzJobExecutor.java b/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzJobExecutor.java
index 2207274..eed8be5 100644
--- a/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzJobExecutor.java
+++ b/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzJobExecutor.java
@@ -75,7 +75,7 @@
return;
}
} else {
- logger.error("No discovery available, therefore not executing job {} with name {} and config {}.",
+ logger.debug("No discovery available, therefore not executing job {} with name {} and config {}.",
new Object[] {job, data.get(QuartzScheduler.DATA_MAP_NAME), runOn[0]});
return;
}
diff --git a/src/main/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinter.java b/src/main/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinter.java
index 84e643d..4c8cf99 100644
--- a/src/main/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinter.java
+++ b/src/main/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinter.java
@@ -68,6 +68,7 @@
final Map<String, SchedulerProxy> proxies = this.scheduler.getSchedulers();
if ( !proxies.isEmpty() ) {
pw.println("Status : active");
+ pw.println("Discovery : " + (QuartzJobExecutor.DISCOVERY_AVAILABLE.get() ? "available" : "not available"));
for(final Map.Entry<String, SchedulerProxy> entry : proxies.entrySet()) {
final Scheduler s = entry.getValue().getScheduler();
try {
diff --git a/src/test/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinterTest.java b/src/test/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinterTest.java
index 8ff225d..5338428 100644
--- a/src/test/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinterTest.java
+++ b/src/test/java/org/apache/sling/commons/scheduler/impl/WebConsolePrinterTest.java
@@ -68,6 +68,7 @@
assertRegexp(reader.readLine(), ".*Apache Sling Scheduler.*");
reader.readLine();
assertRegexp(reader.readLine(), ".*Status.*active.*");
+ assertRegexp(reader.readLine(), ".*Discovery.*available.*");
assertRegexp(reader.readLine(), ".*Name.*ApacheSling.*");
assertRegexp(reader.readLine(), ".*ThreadPool.*testName.*");
assertRegexp(reader.readLine(), ".*Id.*");