This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft 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 Java 8 in Action this week in the Java 8 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: 229
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: 39578
    
  27
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 - updated with new look and Ping home screen widget
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what spring technology can I use for user logs?
 
Similar Threads
Interceptor inside applicationcontext.xml?
Starting with Spring Web Flow and its USP
Bindingresult interface in mvc
Spring + MVC pattern in non-web application
Spring MVC 3 and JSF2 Integration