java - Logging IP addresses for jsf page requests -
i have running jsf2 application , want add request logging feature. logging saved db , consist of standard user/page/ip trio other generated content. now calling dao method in @postconstruct annotated methods in managed beans seems code duplicate. @postconstruct public void init() { loggingdao.save(user,page,ip); } how can centralize logging/auditing process on jsf side using managed beans? since crosscutting scenario, not want add code every managed bean. edit question got lots of comments implies not asked in correct way. one last chance: need log/watch user interaction on site, either may login action or button clicked list items (which maps backing bean methods) or page navigation/redirect. i assume can use same architecture decide if user has rights specific action on site, story since outcomes different. you either use servlet filter or jsf phase listener that. use filter if want log every request, including css , javascript resources. if interest...