I want to monitor when a user logs into aem and print some information into the logininfo.log file. I added an OGSI component and bound it to logininfo.log. But when I log into aem, nothing is printed into the log file. Is my EVENT_TOPIC written incorrectly?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @志鵬劉 correct EVENT_TOPIC for user login in AEM is:
org/apache/sling/auth/core/AuthenticationEvent
The rest code seems correct. If changing the EVENT_TOPIC doesn't work, you can use debugger and see if your code is executing properly or not. Please share the information here.
Hi @志鵬劉 correct EVENT_TOPIC for user login in AEM is:
org/apache/sling/auth/core/AuthenticationEvent
The rest code seems correct. If changing the EVENT_TOPIC doesn't work, you can use debugger and see if your code is executing properly or not. Please share the information here.
Hello @kapil_rajoria - I've tried the same above but I cannot seem to capture the event in logs.
@Component(service = EventHandler.class, immediate = true, property = {
EventConstants.EVENT_TOPIC + "=org/apache/sling/auth/core/AuthenticationEvent" })
public class LoginEventHandler implements EventHandler {
private static final Logger log = LoggerFactory.getLogger(LoginEventHandler.class);
@Override
public void handleEvent(Event event) {
log.info("LOGIN EVENT CAPTURED: {}", event.getTopic());
}
}
What did I miss?
Views
Replies
Total Likes
Views
Likes
Replies