Backend host/port in the log

View: New views
3 Messages — Rating Filter:   Alert me  

Backend host/port in the log

by arungupta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Configured mod_proxy_balancer for front-ending a bunch of GlassFish instances. How do I print the backend host/port in the log ?

Re: Backend host/port in the log

by Jeff Trawick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

arungupta wrote:
Configured mod_proxy_balancer for front-ending a bunch of GlassFish instances. How do I print the backend host/port in the log ?
In general, Apache environment variables (distinct from OS environment variables) are logged via %{envvar-name}e.  The special environment variables created by the balancer are documented at http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html#environment.  BALANCER_WORKER_NAME seems to be the one you want:

BALANCER_WORKER_NAME

    This is assigned the name of the worker used for the current request. The value is something like http://hostA:1234.

Re: Backend host/port in the log

by arungupta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In general, Apache environment variables (distinct from OS environment variables) are logged via %{envvar-name}e.  The special environment variables created by the balancer are documented at
Just what I was looking for, thanks!

The complete blog entry is now available at:

http://blogs.sun.com/arungupta/entry/totd_84_using_apache_mod