Re: logging with portnumber

From: Ulric Eriksson (ulric@siag.nu)
Date: Fri Feb 20 2004 - 00:31:46 CET


On Thu, 19 Feb 2004, WILHARD SPECK wrote:

> I will balance http traffic to 2 Ports on the destination server. It
> works fine, but i can't see to wich port the request was sent in the
> logfile.
> Is there a s solution for ?

The log format is:

client_ip timestamp server_ip request

So there is no way to distinguish between servers based on the destination
port. The easiest solution is to run the two web servers on different ip
addresses on a single server. Otherwise you'll have to modify pen.c, which
is pretty easy. Look at the log() function. Replace the line:

        fprintf(fp, "%s ", inet_ntoa(servers[conns[i].index].addr));

with this:

        fprintf(fp, "%s:%d ", inet_ntoa(servers[conns[i].index].addr,
                servers[conns[i].index].port));

Now the log format will be:

client_ip timestamp server_ip:port request

Ulric



This archive was generated by hypermail 2.1.2 : Fri Feb 20 2004 - 00:31:58 CET