IntelliJ Java IDE
The moose likes Spring and the fly likes Logging aspect Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Logging aspect" Watch "Logging aspect" New topic
Author

Logging aspect

Muhammad Abdul Arif
Greenhorn

Joined: Feb 04, 2012
Posts: 14
I need to create a logging aspect in my application which will log statements if the control enters or exits a method. And i need to do this for all the methods in all my classes under package com.swift.xyz.*
xyz package intern contains other packages. I tried with below expression but of no use.

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

so

"execution(* com.swift.xyz.*.*(..))"

Will only do classes directly in the com.swift.xyz package, but not subpackages. To get subpackages, I would recommend

"execution(* com.swift..*.*.*(..))"

or maybe

"execution(* com.swift.xyz..*.*.*(..))"

One of those two will give you exactly what you are looking for to get all classes in com.swift.xyz and all its subpackages.

Mark

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Muhammad Abdul Arif
Greenhorn

Joined: Feb 04, 2012
Posts: 14
Thanks Mark its working.
 
 
subject: Logging aspect
 
Threads others viewed
unable to Apply Aspects to simpleformcontroller class methods
java.lang.IllegalArgumentException: The input() is not defined in action class $Proxy262
Can't get Spring AOP to work in tomcat
Pass parameter to aop:before method in Spring
How to Use Spring AOP for Auditing?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture