User IP address

Hello

I want to know from the logs the user who made an action and also the IP address of the machine he used. I can see the user’s name in the logs, but the IP address is that of the server that is logged in instead of the user’s IP. So I don’t have the possibility to see the IP of the user’s machine. is it normal that it is the IP of the server that is logging?

Regards

Hi @didate,

Yes, it depends on their Internet Service Provider (ISP) and how they’re accessing the internet. If a person is using a VPN, for example, it will not show the IP Address given to the client by the ISP.

Hello @Gassim thank you for your response

humm I think even if the user uses a VPN there will always be an IP behind, even if the IP is fake.

In any case, our users do not use VPN, but all actions are logged with the server’s IP.

btw, I am using the Lxc installation method, does the proxy container not consider the host machine to be the client ?

1 Like

Thanks @didate! I see what you mean. I think the issue is described in this stackoverflow thread: java - How to log Client IP and X-Forwarded-For IP in tomcat access log - Stack Overflow

Hope it helps!

Thank you @Gassim

I’m going to try this. I will let you know if it work.

Regards

1 Like

Hi @didate . If you have a reverse web proxy in front (NGINX or Apache) you can probably crosscheck its logs with the ones from Tomcat to get the specific IP of the user.

EDIT: I am not sayiing that what @Gassim is saying is not a good option so you can find it in the same source but fi you are trying to get something from the past that’s how I would do it.

1 Like