@Loggable annotation in the controller does not work
Closed this issue · 4 comments
Hi @Ananto30 ,
Thank you for your annotation. Since I am pretty beginner to entire Spring stack it was helpful to understand via your thorough explanation. However, I have trouble running your code snippets.
Basically, I imported everything in my project however cannot directly use @loggable in my controller and get following error.
error: annotation type not applicable to this kind of declaration
@loggable
Since I am beginner and perhaps making some stupid mistakes.
Thank You
Firstly this is @Loggable
with capital L 😅
This is a library. Have you imported the library in your gradle or maven? And have you added a bean of LoggerAspect
? Because this is a Aspect
class. For more info please refer to https://docs.spring.io/spring/docs/4.3.15.RELEASE/spring-framework-reference/html/aop.html
And please share where have you put the annotation. Or better to share your whole approach to use this library.
(I know there's no readme in this repo. I will add it in my free time. 😶)
Thank you for your prompt reply @Ananto30
Actually I have imported all the required libraries based on your gradle config ie lombok, aspectjweaver(instead of this one I have imported spring-boot-starter-aop), spring-boot-starter-webflux, org.slf4j:slf4j-simple,etc
And created new package called loggable and put your Loggable and LoggerAspect...
Now, I want to use the @loggable annotation.. inside my controller package and seems it is inaccessible there... perhaps need to register as Beans?
Thanks again.
Hi @jsherchan, really sorry I have missed this comment. Just checked and found.
Yes, this should be registered as Bean. Have you solved it already?
Closing this as @jsherchan didn't reply and it's not an issue.