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
BedrockMission!

Learn More

View all

Sign in to view all badges

Audit log with extra information

Avatar

Avatar
Validate 1
Level 1
infinityskyline
Level 1

Like

1 like

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
infinityskyline
Level 1

Like

1 like

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
infinityskyline
Level 1

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back
Level 4
Sanket_Kumbharkhane
Level 4

Likes

46 likes

Total Posts

50 posts

Correct Reply

20 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Give Back
Level 4
Sanket_Kumbharkhane
Level 4

Likes

46 likes

Total Posts

50 posts

Correct Reply

20 solutions
Top badges earned
Give Back
Boost 5
Boost 3
Boost 25
Boost 10
View profile
Sanket_Kumbharkhane
Level 4

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.

Answers (3)

Answers (3)

Avatar

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

190 likes

Total Posts

199 posts

Correct Reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile

Avatar
Springboard
Level 7
KiranVedantam1992
Level 7

Likes

190 likes

Total Posts

199 posts

Correct Reply

60 solutions
Top badges earned
Springboard
Give Back 5
Ignite 1
Affirm 50
Validate 1
View profile
KiranVedantam1992
Level 7

27-01-2021

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.

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,133 likes

Total Posts

3,161 posts

Correct Reply

1,079 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

31-01-2021

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?

Avatar

Avatar
Boost 5
Level 3
kiranparab
Level 3

Likes

23 likes

Total Posts

36 posts

Correct Reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Level 3
kiranparab
Level 3

Likes

23 likes

Total Posts

36 posts

Correct Reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
kiranparab
Level 3

27-01-2021

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.

 

kiranparab_0-1611754357284.png

 

 

Thanks,

Kiran Parab