Sling health check hints

July 29, 2017    tutorial aem sling health check


How improve your health check with info and hint messages

May be you are already familiar with AEM operations dashboard if not check this.

On this dashboard you can find a lot of useful tools but now we are interested in “HealthCheck Reports”

dashboard

You can overview several of them and notice that some of them has hints and info messages at the top.

traversal health check

You can easy find how to create a healthcheck over the internet, but how to add ‘hints’ or ‘info’ messages not.

If you think that is hard and does not worth to do you are strongly mistaken. You just need to add a message into resultLog in a specific format. And this format is simple markdown link.

   //    Hint matcher markdown pattern [text](link)
    private static final String SIMPLE_HINT = "[Simple hint message for health check](https://github.com/AndreiShilov/sample-aem-kotlin-maven)";

    //    Info is a Hint without a link (space instead of a link)
    private static final String SIMPLE_INFO = "[Simple info message for health check]( )";
    @Override
    public Result execute() {
        final FormattingResultLog resultLog = new FormattingResultLog();

        resultLog.info(SIMPLE_INFO);
        resultLog.info(SIMPLE_HINT);

        return new Result(resultLog);
    }

simple-health-check

Full healthcheck code could be found here




comments powered by Disqus