2

Is there any way I can track the logged in users in geoserver(somewhere in log file). I have same users in geoserver and tomcat-realm.As I can see what URI are requested, IP address URI requested from, time and other info in access log of apache. But I need to find user name who logged in to request those URI.

Thanks

1
  • Can you pass the user.ID variable to the log you're already maintaining? I assume if the instance is running and the user is logged in, their user.ID variable will be stored somewhere.
    – dassouki
    Commented Jan 6, 2012 at 19:42

1 Answer 1

3

Edit the tomcat configuration file (in conf/server.xml) and add an AccessLog Valve.

The common log format already logs the username along with url and is common in the sense that most log processing tool can process it out of the box.

3
  • I had already added accesslog valve in server.xml file of tomat, but all the time I didn't notice the username was tracked there in access log of tomcat. Thanks a lot guys for the good hints guys.
    – panalbish
    Commented Jan 8, 2012 at 16:14
  • Also I would like to add that, I was getting the local apache IP as client IP in tomcat access log, so I modified the server.xml to get the remote client IP using %{X-Forwarded-For}i header in log pattern. Hope it will be helpful for someone having same issue. Thanks
    – panalbish
    Commented Jan 8, 2012 at 19:25
  • @panalbish for that a better solution is the remoteip valve tomcat.apache.org/tomcat-7.0-doc/config/…
    – unicoletti
    Commented Jan 9, 2012 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.