Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Substitute AuditLog entries

Amurita
Level 2
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
Amurita
Correct answer by
Level 2
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
Amurita
Correct answer by
Level 2
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