How to print access log without spring?

113 Views Asked by At

What I really want is AOP, which is supported in spring. But sadly my leader didn't allow us to use spring. We write a service layer with java, thrift and jdbc. I used to use spring's aspect to print the access logs in every action. So I don't know how to do this now. I tried a plugin named jcabi-aspect but it didn't work. And also I didn't figure it out.
So I wanna know if there is some thing can help me to do this.

1

There are 1 best solutions below

0
On

You can use AspectJ which is

  • more powerful than the small AspectJ language subset implemented in Spring AOP,
  • faster and more resource-efficient because it does not need/use dynamic proxies,
  • useable in any Java SE application without any frameworks like Spring or Java EE.

Extensive documentation can be found here.

Now the remaining question is whether your leader will grant you permission to use AspectJ. ;-)