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?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
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.
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.
Hi @infinityskyline,
For logging all the user-level activities, you can write a filter and log them to a custom log. Related thread here.
If you need only the content level changes, you can write some listeners and can log the activities. Please find my blog for the annotations here.
Hope this helps!
Thanks,
Kiran Vedantam.
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.
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.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi,
You don't have to write any custom code for listeners instead you can go with ACS commons available feature Audit log serch
https://adobe-consulting-services.github.io/acs-aem-commons/features/audit-log-search/index.html
It will Trace all the Audit log depends on your Event Type like Page created, Page deleted, etc.. and provide the required information as needed till the date Audit log is available in instance. Purging for Audit log should not happen for that particular date.
Thanks,
Kiran Parab
Views
Replies
Total Likes
Hi @infinityskyline,
AEM internally logs User activities Audit relates to Page, DAM and Replication events which is OOTB completely in Author mode and the ACS commons Audit-log-search provides the search on the top of it.
Then why are you looking for another custom logs top of it ?
There are three types of Audit Logs options:
1. Page Audit logs
2. DAM Audit logs
3. Replication Audit logs
- If your requirement already covers the events required for this OOTB audit logs available then, you don't have to worry about eventListners to write the custom code again for same case.
- If it not covers your events then, you should go for custom code option with eventListners to write as per demand.
Below is the purging option for above audit logs -
Thanks,
Kiran Parab
Views
Replies
Total Likes
Views
Replies
Total Likes
That's True. But If you are trying to capture very granular level properties or modified transactions then author will slow down with all this logging log sizes and my suggetion is don't go with Debug mode.
If author replicates the final version to publisher then, it will create the auto created version in Author and easy to find diff the page with older version if you really looking for changes.
As i said Audit OOTB logs also captures the timesstamp for each transaction so it will helpful to backtrack to do reverse engineering.
This might help to take call on your usecase.
Thanks,
Kiran Parab
Views
Replies
Total Likes
As already stated, it's not useful to log all repository changes, because 1) you have to filter out the changes caused by system processes 2) no one will ever review these changes, 3) they slow down the system and 4) consume a lot of storage.
For what purpose do you need the audit log? What is the livecycle of these audit log data, how long do you want/need to keep them?
Views
Like
Replies
Views
Likes
Replies