Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Substitute AuditLog entries

Avatar

Level 2

Hi everyone,

I am currently working with AEM 6.1 SP2. What I want to achieve is the substitution/extension of the system PageEventAuditListener.

For that reason I write my own PageEventAuditHandler. It should listen just for PageEvents. However I do not know how to connect my service to the current AuditLog, so that I could write my own AuditLogEntries to it.

I appreciate every hint/tip to solve that issue.

Output of error.log:

18.10.2016 10:30:05.463 *ERROR* [pool-11-thread-3-null(null)] org.apache.sling.event.jobs.JobUtil Unhandled error occured in job processor null while processing job org.osgi.service.event.Event [topic=com/day/cq/wcm/core/page]
java.lang.NullPointerException: null
        at com.testing.handlers.OwnPageEventAuditHandler.handlePageEvent(OwnPageEventAuditHandler.java:158)
        at com.testing.handlers.OwnPageEventAuditHandler.process(OwnPageEventAuditHandler.java:86)
        at org.apache.sling.event.jobs.JobUtil$1.run(JobUtil.java:366)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

To speed up things I attached the source code of my service.

Thanks for your help in advance.

 

Best regards,

Marcus

1 Accepted Solution

Avatar

Correct answer by
Level 2

I got a solution for the problem.

Instead of the binding just use a reference for the auditlog.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

I got a solution for the problem.

Instead of the binding just use a reference for the auditlog.