| Author |
Why Spring AOP is preferred over log4j or common-logging?
|
Dattatraya Tembare
Greenhorn
Joined: Feb 01, 2009
Posts: 10
|
|
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?
|
 |
Saifuddin Merchant
Ranch Hand
Joined: Feb 08, 2009
Posts: 576
|
|
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.
|
Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
|
 |
Dattatraya Tembare
Greenhorn
Joined: Feb 01, 2009
Posts: 10
|
|
|
Thanks! Sam.
|
 |
Kathleen Angeles
Ranch Hand
Joined: Aug 06, 2012
Posts: 115
|
|
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.
|
 |
 |
|
|
subject: Why Spring AOP is preferred over log4j or common-logging?
|
|
|