views:

213

answers:

2

How to make a logging list of Users' IP addresses, should this be done via tomcat or grails or a combination of both

+1  A: 
ServletRequest.getRemoteAddr()
Gandalf
didn't work for me!!
tranced_UT3
There are indeed circumstances wherein this won't work. E.g. the server is sitting behind a proxy and would thus only retrieve the proxy's IP as remote addr instead. When you're using a bit decent proxy, the original IP is often just present in another request header, usually the `X_FORWARDED_FOR` one.
BalusC
A: 

It works for me. I am also using the request.getRemoteAddr() to store client IP address to database.

Jay Chandran