# Logging Client IPAddress/Hostname

**URL:** <https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217>\
**Category:** Classic Servoy\
**Created:** [April 18, 2017, 6:23am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217 "2017-04-18T06:23:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [April 18, 2017, 6:23am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/1 "2017-04-18T06:23:08Z")

</div>

Hello,  
how can I get the client IPAddress/Hostname etc?

application.getIPAddress returns IP serverside  
application.getHostName returns Servername  
application.getOSName returns Server-OS

Additionally I tried the usermanager plugin with the same results:

var vClient = plugins.UserManager.Client();  
vClient.ipAddress returns Server-IP  
vClient.hostAddress returns Server-IP  
vClient.hostName returns Servername;  
vClient.osName returns Server-OS

Any ideas?

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [April 18, 2017, 7:28am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/2 "2017-04-18T07:28:12Z")

</div>

I guess this is webclient? Then it’s obvious, because your client runs on the server, so all calls to the Java virtual machine are made to the one of the server. To figure out these things in a client browser, you need to google a bit. External IP addresses can be resolved using external scripts and the navigator object offers quite some properties to narrow down operating system etc.

---

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [April 18, 2017, 7:48am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/3 "2017-04-18T07:48:32Z")

</div>

Yes it’s webclient.  
Client informations like IP and timeZone are visible on the Servoy server-administration page so I don’t understand why Servoy has no functionality to readout important informations like that.  
Anyway, i will create a workaround to get these informations.

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [April 25, 2017, 8:06am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/4 "2017-04-25T08:06:00Z")

</div>

I use the UserManager plugin to do exactly what you want. plugins.UserManager.Client().hostAddress should give you the client IP address of the current client as shown in the screenshot which is taken from a web client:

[attachment=0]IP Address.png[/attachment]

Hope this helps  
Steve

 ![IP Address.png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/2X/5/5fa4ead1867e6c8c12d16b07c9763c142be9c574.png)

---

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [April 25, 2017, 8:18am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/5 "2017-04-25T08:18:49Z")

</div>

That’s not correct, Steve.  
Running webclient from WAN shows the application servers external IP, Hostname etc.

---

<div class="post-metadata">

**Author:** ![steve1376656734](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/steve1376656734/32/4613_2.png) [@steve1376656734](https://forum.servoy.com/u/steve1376656734)\
**Post date:** [April 26, 2017, 2:01pm UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/6 "2017-04-26T14:01:10Z")

</div>

Definitely not how it is doing it on my server. I am using it to ensure each user logs on only once from any given IP address and the value I am getting for the HostAddress is definitely the same IP as Servoy is showing in the connected clients screen. The screenshot I posted is taken live from our running server (Centos 7) and the address shown for the UserManager IP address is the WAN address of the server and the one shown as the UserManager host address is that of my ADSL line. I am running Servoy 8.1.2 and UserManager version 2.1.10

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [April 26, 2017, 2:10pm UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/7 "2017-04-26T14:10:35Z")

</div>

The UserManager takes it from the same object as servoy-admin… So what you see on the client in servoy-admin is what you get from UserManager.

---

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [April 27, 2017, 9:11am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/8 "2017-04-27T09:11:11Z")

</div>

That’s strange because it’s different in my solution. Maybe because I use it in the frameworks authentication module?  
Now I will try to hand it over to the authenticator solutionType with the authenticationObject. Maybe that’s the trick.

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [April 27, 2017, 10:17am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/9 "2017-04-27T10:17:40Z")

</div>

The authenticator is a solution that always runs server side… That’s the whole point about it ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![briese-it](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@briese-it](https://forum.servoy.com/u/briese-it)\
**Post date:** [April 27, 2017, 10:30am UTC](https://forum.servoy.com/t/logging-client-ipaddress-hostname/19217/10 "2017-04-27T10:30:16Z")

</div>

I see.  
Perfect, then my idea with passing the client informations as parameter to the authenticationObject should work. I’ll see it this evening after updating the server.
