Expand my Community achievements bar.

SOLVED

How To Enable Audit on /var/commerce/products path

Avatar

Level 1
Level 1

Hi Team,

 

What is the process/steps to enable auditing on /var/commerce/products path. Request you to provide the inputs.

 

Regards,

Kalyan

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can write an JCR/Sling event listener for node add/modify and inside that you can check the condition and create event logs

AuditLogEntry auditLogEntry = new AuditLogEntry(node.EVENT_TOPIC, node.getModificationDate(), node.getUserId(), node.getPath(), "Node updated", node.getEventProperties());
			entries.add(auditLogEntry);

 



Arun Patidar

View solution in original post

4 Replies

Avatar

Level 1
Level 1

Thanks Arun for your Reply.

The link that you have provided is for enabling the audit for page is there any example how we can implement for /var/commerce/products .

Regards,

Kalyan

 

Avatar

Correct answer by
Community Advisor

You can write an JCR/Sling event listener for node add/modify and inside that you can check the condition and create event logs

AuditLogEntry auditLogEntry = new AuditLogEntry(node.EVENT_TOPIC, node.getModificationDate(), node.getUserId(), node.getPath(), "Node updated", node.getEventProperties());
			entries.add(auditLogEntry);

 



Arun Patidar

Avatar

Administrator

@ns6 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni