• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Logging aspect

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Muhammad Abdul Arif
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mark its working.
reply
    Bookmark Topic Watch Topic
  • New Topic