Substitute AuditLog entries | Community
Skip to main content
Level 2
October 18, 2016
Solved

Substitute AuditLog entries

  • October 18, 2016
  • 1 reply
  • 1607 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Amurita

I got a solution for the problem.

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

1 reply

AmuritaAuthorAccepted solution
Level 2
October 18, 2016

I got a solution for the problem.

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