• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why Spring AOP is preferred over log4j or common-logging?

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Why Spring AOP is preferred over log4j or common-logging?

What are the advantages over these two?

I have seen some discussion & found that mix approach can be used... Can anyone elaborate that where & how to handle such situation?


 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring AOP is NOT preferred over log4j or common-logging?
Spring AOP is used in conjunction with and logging framework - log4j, slf4j or commons-logging to separate logging concern from your main business code.

I suggest looking at the spring source provided aspect training - http://www.springsource.com/training/free-online-training-developing-aspects-a
It provides a great overview of AOP & the example used is of logging so you'll get a really good understanding of how to use Spring AOP for logging.
 
Dattatraya Tembare
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! Sam.
 
Ranch Hand
Posts: 123
Firefox Browser Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
logging frameworks like log4j are specialized and focused on best logging options and features.

spring aop or any aspect system will be an overkill unless:

1. you need more than logging
2. it is a cross-cutting concern. that means, your custom logging action needs to be applied to many areas or classes in your application.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic