Created scheduler but not able to see log output in the project log
Below is the code for configuring the scheduler. You can refer to the screenshot of the configuration
@ObjectClassDefinition(
name = "AEM: SlingSchedulerConfiguration",
description = "Sling scheduler configuration"
)
public @interface SchedulerConfig
{
@AttributeDefinition(name = "Cron-job expression")
String scheduler_expression() default "*/10 * * * * ?";
@AttributeDefinition(name = "A parameter",
description = "Can be configured in /system/console/configMgr")
String myParameter() default "";
}
@Designate(ocd=SchedulerConfig.class)
@8220494(service=Runnable.class, immediate = true)
public class MyScheduler implements Runnable
{
private final Logger logger = LoggerFactory.getLogger(getClass());
private String myParameter;
@9944223
public void run() {
logger.debug("MyScheduler is now running, myParameter='{}'", myParameter);
}
@580286
protected void activate(final SchedulerConfig config) {
myParameter = config.myParameter();
}
}
