Audit log with extra information

Avatar

Avatar

infinityskyline

Avatar

infinityskyline

infinityskyline

26-01-2021

My project has requirement to log all user activities.. i.e., what all is happening in the environment and by whom. I have enabled  audit logging feature in AEM by going to http://localhost:4502/system/console/slinglog -> change the log level of logs/audit.log to DEBUG.

 

This solves my purpose and logs all the user activities but it doesn't log what content changes has been made. For example, if value of a property is changed from "Hello World" to "Hello Earth" I want to log both old and new values, if not both at least the new value.

 

Is this possible? If not using audit log, can be done with custom logs or any workflows?

AEM audit console logs
View Entire Topic

Avatar

Avatar

Sanket_Kumbharkhane

Avatar

Sanket_Kumbharkhane

Sanket_Kumbharkhane

27-01-2021

You can use an event listener to listen to all the activities on your website. Create a separate class and log all the activities in info mode. 

  1. NODE_ADDED
  2. NODE_MOVED
  3. NODE_REMOVED
  4. Event.PERSIST
  5. PROPERTY_ADDED
  6. PROPERTY_CHANGED
  7. PROPERTY_REMOVED

https://aem.redquark.org/2018/10/day-14-eventing-in-aem.html

 

and then register that class with a new log file name at

http://localhost:4502/system/console/slinglog

 

Note: Its better to add more restriction to listen to those events like

a. listen only for cq: page 

b. under a specific  parent folder

c. Strictly for Author

as per the requirement.