How To Enable Audit on /var/commerce/products path | Community
Skip to main content
October 26, 2023
Solved

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

  • October 26, 2023
  • 2 replies
  • 751 views

Hi Team,

 

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

 

Regards,

Kalyan

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 arunpatidar

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);

 

2 replies

arunpatidar
Community Advisor
Community Advisor
October 26, 2023
ns6Author
October 27, 2023

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

 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 27, 2023

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
kautuk_sahni
Community Manager
Community Manager
October 30, 2023

@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