Motivation

I want to debug a certain class, e.g. apps.training.components.listchildren.ListChildren.java

Logger Configuration

Configure a specified Logger in http://localhost:4502/system/console/configMgr

Add a new logger:

Log Level : TRACE

Log File : logs/custom.log

Logger : apps.training.components.listchildren

Logging

package apps.training.components.listchildren;

import com.adobe.cq.sightly.WCMUsePojo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ListChildren extends WCMUsePojo {
    private static final Logger log = LoggerFactory.getLogger(ListChildren.class);

    @Override
    public void activate() throws Exception {
        log.trace("activate");
    }

}

After this class is instantiated and run, a log message will be added in AEM quickstart's logs folder, in custom.log:

14.09.2016 15:39:27.730 *TRACE* [127.0.0.1 [1473860367336] GET /content/training-site/en/products.html HTTP/1.1] apps.training.components.listchildren.ListChildren activate

results matching ""

    No results matching ""