This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes what spring technology can I use for user logs? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "what spring technology can I use for user logs?" Watch "what spring technology can I use for user logs?" New topic
Author

what spring technology can I use for user logs?

Kent de Guzman
Greenhorn

Joined: Sep 13, 2013
Posts: 12

Hi
I'm a newbie in Spring MVC, and currently developing admin side of my simple web app.
Now I want to have an idea what is the best way or technology to create user logs? I read about Interceptors of Spring MVC, Spring Security and Spring Aop but I don't know if I can use them for user logs. Any idea Thanks.
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 235
Spring Security is not for logging.
Interceptor is only for web applications and it has only pre- and post-handlers.

Spring AOP provides more features and can be used for any application.
It provides different join points like Before, After, Around, After returning, After throwing exception by a method.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41129
    
  45
Why Spring? There are so many elaborate logging frameworks that I don't think yet another one somehow attached to the Spring brand would be a big improvement. These days, slf4j seems to be most fashionable.


Ping & DNS - my free Android networking tools app
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Ulf Dittmer wrote:Why Spring? There are so many elaborate logging frameworks that I don't think yet another one somehow attached to the Spring brand would be a big improvement. These days, slf4j seems to be most fashionable.


Spring does not offer a Logging framework for that very reason. Use SL4J with Logback as your implementation on new projects.

As was mentioned you can use AOP to handle the logging. Logging is a cross cutting concern, so it is a prime candidate for AOP. However AOP does not do the logging Logback does.


[How To Ask Questions][Read before you PM me]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: what spring technology can I use for user logs?
 
Similar Threads
Spring + MVC pattern in non-web application
Spring MVC 3 and JSF2 Integration
Starting with Spring Web Flow and its USP
Interceptor inside applicationcontext.xml?
Bindingresult interface in mvc