Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Integrating AOP with AEM

Avatar

Level 1

Hi Team,

I was looking for the "Integrating  AOP with AEM",

I have a project for which an extra set of Loggers are required like getting the method execution time and name of the methods which are being called .

Is this possible ? If Possible please let me know the other ways to get loggers .

thanks,

Keerthi.

6 Replies

Avatar

Level 10

Here is a community blog that will point you in the right direction: Integrating Spring AOP with AEM | TO THE NEW Blog

Avatar

Level 1

Thanks for the reply Scott, I have followed the same steps but could able to achieve it.

I have commented in the same site couple of weeks ago but didn't get any reply.

After following the article I could resolve the dependencies and errors but the LoggerAspect.java(the interceptor not getting invoked) class is not getting called .

Could you please suggest me on this .

I have also followed couple of other methods like

ref : Idea Fountain: Demystifying AOP, Getting started with LTW (load time weaving)  - aop.xml is not getting invoked.

Thanks,

Keerthi.

Avatar

Level 10

Well using Spring framework is not typically best practice.

I would recommend using logger available with Sling.

Apache Sling - Logging

Avatar

Level 1

Yes sure Scott, i was thinking of doing with normal aspectj aop which doesn't require spring..

i need some data like method name , method execution time etc logged in the logs for maintenance purpose for this i'm thinking of aop.

Thanks,

Keerthi.

Avatar

Level 9

Hi,

Implementing AOP should not be a problem. However, Simple Sling Request Filter & Response filter might be helpful. Not sure how much Sling could be useful to solve your problems.

Regards,

Jitendra

Avatar

Level 1

Thanks for the reply Jitendra, i couldn't achieve it through Sling.

Can you please suggest me how can i Implement AOP with AEM, I have noted the references which i have followed.

Thanks,

Keerthi.