wood burning stoves 2.0*
The moose likes Aspect Oriented Programming and the fly likes Why Spring AOP is preferred over log4j or common-logging? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Bookmark "Why Spring AOP is preferred over log4j or common-logging?" Watch "Why Spring AOP is preferred over log4j or common-logging?" New topic
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: 597

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: 122

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why Spring AOP is preferred over log4j or common-logging?
 
Similar Threads
Logging Implementation using Spring AOP or AspectJ
uses of aop in spring
AOP
AOP
What is AOP?