Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Customize logs for access with Spring Security  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We were trying to create access logs for our web application. Currently we are using the Spring Security 3 for authentication & authorization. We were able to get the DEBUG logs entries for all activities in the spring security framework. But, we want to generate logs which would allow us to view LogIn , Logout, Access Denied, entries customized for our needs. Also, we want the Log level to be INFO and not DEBUG for performance reasons. Is there any way we can do that in Spring? I was thinking of adding another Filter which would be invoked by the spring secirity filters after processing the request...But I am not sure if that is possible.

If anyone has already tried something similar, please help us with this.

Thanks
Sam
 
Author
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,

You probably want to look into hooking into the authentication events published by the framework, which uses the standard Spring ApplicationListener functionality. The Spr Sec framework ships with "LoggerListener", which should provide you with an example of how to use these. Refer to the Javadoc for the relevant classes here.

Best,
Peter
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I see using logger listener we can log events such as Authentication Credentials Not Found, Authorization Failure and Authorized . but how can i log logout event?? is there any other way like logger listener.? or do i have to implement custom logout Filter??
please help.

Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!