iay / mdq-server-docker

mdq-server deployment as Docker containers
1 stars 3 forks source link

add client info to log entry #13

Closed trscavo closed 9 years ago

trscavo commented 9 years ago

In the spring logs, the 'query by identifier, id=' line is most interesting. Can something about the client be logged, perhaps an IP address?

iay commented 9 years ago

It is possible that there is already a conventional HTTP log being generated by the container (Jetty) but that might not be enabled by Spring Boot by default. I'll look into either making that visible or just putting something in the application logs.

iay commented 9 years ago

I have added some basic client request logging to mdq-server in iay/mdq-server@f2052db185a7b71d80738c079b42dc702918f6d3.

The result looks like this (I've wrapped the line to make it more obvious):

2015-01-22 12:34:53.778 DEBUG 4470 --- [qtp868969187-16]
    uk.org.iay.mdq.server.RequestLogger      : GET for '/entities' from 127.0.0.1

I'll hold this open until we've had a chance to try it in a deployment of some kind.

iay commented 9 years ago

On my staging system, the deployment is behind a proxy so the IP address of the proxy is always shown. However, this seems to be working if the server is exposed direcly, as in the mdq-beta.incommon.org case.

Closing this; the "behind a proxy" case is iay/mdq-server#24.