tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: obtain X-Forwarded-for: client-IP-address in access logs
Date Fri, 03 Nov 2006 22:14:01 GMT
you can acquire the local IP (%A) and remote IP (%a) if you implement AccessLogValve

This e-mail communication and any attachments may contain confidential and privileged information
for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified
that you have received
this communication in error and that any review, disclosure, dissemination, distribution or
copying of it or its 
----- Original Message ----- 
From: "Maurice Yarrow" <>
To: "Tomcat Users List" <>
Sent: Friday, November 03, 2006 4:23 PM
Subject: obtain X-Forwarded-for: client-IP-address in access logs

> Hello Tomcat community
> I have tomcat (5.0.28) running behind pound (2.1.3) 
> reverse-proxy-load-balancer.
> This is a very effective setup, as I have pound also fronting apache and 
> mongrel-rails
> clusters.
> Question:
> Pound adds the following to its request to backend servers:
>     X-Forwarded-for: client-IP-address
> I would like to be able to obtain this client-IP address in the tomcat 
> access logs.
> I tried all available formats (%a,  %A,  %b,  %B,  etc.,etc.) for the 
> logger pattern,
> but of course, none produced the client IP address placed in the request by
> Pound. 
> I could, of course, grep through the Pound log output which, by default, 
> winds
> up on /var/log/messages, but would rather just be able to see this in the
> tomcat access log.
> How could I, say, derive my own logger class and capture this header 
> info that
> pound places in the request to backend server ??
> Is there a simpler way ?   Am I unaware of a direct way to do this ?
> Maurice Yarrow
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:
View raw message