users@glassfish.java.net

Re: Glassfish - Loadbalancing and X-Forwarded-For HTTP Header

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 17 Feb 2009 10:30:22 -0800

Hi Stephan,

On 02/17/09 08:43 AM, glassfish_at_javadesktop.org wrote:
> Hallo!
>
> We are using a L7 loadbalancer. The loadbalancer adds the real origin of the request as additional X-Forwarded-For HTTP Header
>
> Is there a way to log X-Forwarded-For in the Access Log?
>

Yes, this is possible. In order to access-log a specific request
header, you can use an access-log token of the form "header.<name>",
where <name> is the name of the request header.

For multi-values request headers, use "headers.<name>".

In your case, you can specify

  <access-log format="... %header.X-Forwarded-For% ..."/>

in your domain.xml (you can update your domain.xml via the CLI,
admin GUI, or manually).

Also make sure you have access-logging turned on.

Thanks,


Jan


> Thanks
> Stephan
> [Message sent by forum member 'iceandfire' (iceandfire)]
>
> http://forums.java.net/jive/thread.jspa?messageID=332298
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>