posted 4 years ago
Knowing a source IP address is not generally all that useful, since there's the remote client's actual IP address and then there's the IP address(es) of one or more intermediary proxies and NAT services. Headers attempt to recover some of that information, but headers can be forged or tampered with, and not all intermediaries may even inject headers.
In any event, Jay's attempt to manually log was questionable itself, since Tomcat does have a Valve that can do that sort of thing so there's little need to write application code for that. The Tomcat log, however, will list the latest IP address in the chain, which is the only one that's actually reliable, since TCP/IP cannot work with a fake address in the packet header. UDP can be spoofed - and often is for things like nameserver DDOS, but Tomcat doesn't use UDP protocols.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.