Package org.apache.sling.hc.util

Examples of org.apache.sling.hc.util.FormattingResultLog.warn()


            final long randomDelay = (long)(Math.random() * (maxExecutionTime - minExecutionTime));
            final long toSleep = minExecutionTime + randomDelay;
            resultLog.debug("Executing {} will last {} msec", this, toSleep);
            Thread.sleep(toSleep);
        } catch(InterruptedException iex) {
            resultLog.warn("{} during execution", iex.getClass().getSimpleName());
        }
        final String execMsg = "Done executing, execution counter=" + counter.incrementAndGet();
        resultLog.debug("{}:{}", this, execMsg);
        log.debug("{}:{}", this, execMsg);
        return new Result(resultLog);
View Full Code Here


       
        final FormattingResultLog resultLog = new FormattingResultLog();

        resultLog.info("{} - counter value set to {} at {}", this, value, new Date());
        if(value % 2 != 0) {
            resultLog.warn("Counter value ({}) is not even", value);
        }
        return new Result(resultLog);
    }
}
View Full Code Here

        resultLog.debug("Checking {} / {} with constraint {}", mbeanName, attributeName, constraint);
        try {
            final MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
            final ObjectName objectName = new ObjectName(mbeanName);
            if(jmxServer.queryNames(objectName, null).size() == 0) {
                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);
            }
View Full Code Here

                final Object value = engine.eval(expression, b);
                if(value!=null && "true".equals(value.toString().toLowerCase())) {
                    resultLog.debug("Expression [{}] evaluates to true as expected", expression);
                } else {
                    resultLog.warn("Expression [{}] does not evaluate to true as expected, value=[{}]", expression, value);
                }
            }
        } catch (final Exception e) {
            resultLog.healthCheckError(
                    "Exception while evaluating expression [{}] with language extension [{}]: {}",
View Full Code Here

                            ReplicationQueueItemState status = q.getStatus(item);
                            if (status.getAttempts() <= numberOfRetriesAllowed) {
                                resultLog.debug("Queue: [{}], first item: [{}], number of retries: {}", q.getName(), item.getId(), status.getAttempts());
                            } else {
                                // the no. of attempts is higher than the configured threshold
                                resultLog.warn("Queue: [{}], first item: [{}], number of retries: {}, expected number of retries <= {}",
                                        q.getName(), item.getId(), status.getAttempts(), numberOfRetriesAllowed);
                                failures.put(q.getName(), status.getAttempts());
                            }
                        } else {
                            resultLog.debug("No items in queue [{}]", q.getName());
View Full Code Here

                        } else {
                            resultLog.debug("No items in queue [{}]", q.getName());
                        }

                    } catch (Exception e) {
                        resultLog.warn("Exception while inspecting replication queue [{}]: {}", q.getName(), e);
                    }
            }
        } else {
            resultLog.debug("No replication queue providers found");
        }
View Full Code Here

        }

        if (failures.size() > 0) {
            // a specific log entry (using markdown) to provide a recommended user action
            for (Map.Entry<String, Integer> entry : failures.entrySet()) {
                resultLog.warn("Replication queue {}'s first item in the default queue has been retried {} times (threshold: {})",
                        entry.getKey(), entry.getValue(), numberOfRetriesAllowed);
            }
        }

        return new Result(resultLog);
View Full Code Here

                if (StringUtils.startsWithAny(path, paths)) {
                    String thumbnailPath = template.getThumbnailPath();

                    if (thumbnailPath == null) {
                        templatesWithoutIcons++;
                        resultLog.warn("Template {} doesn't have a thumbnail.", path);
                    }
                }
            }

            if (templatesWithoutIcons > 0) {
View Full Code Here

                if (StringUtils.startsWithAny(path, paths)) {
                    String iconPath = component.getIconPath();

                    if (isDroppable(component) && !isPageType(component) && iconPath == null) {
                        componentsWithoutIcons++;
                        resultLog.warn("Component {} is editable, but doesn't have an icon.", path);
                    }
                }
            }

            if (componentsWithoutIcons > 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.