Forum: Ruby on Rails RE: logging a users ip address

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tom F. (Guest)
on 2005-12-27 09:55
(Received via mailing list)
Typically, this information is added to the access log by the web

The Rails default logging also outputs this information, even in
production mode:

  Processing <controller>#<action> (for <user-ip> at <date-time>) GET

If you want to put this in the Rails log file in your own format, it can
be found in your request.env collection under REMOTE_HOST, e.g. "Users IP: #{request.env['REMOTE_HOST']}"
This topic is locked and can not be replied to.