You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Leo Nikolaev <ni...@kasatkina.org> on 2014/08/03 14:00:09 UTC

Error log vhost addition

Hi,

 

I'd like to propose a small patch to the error log routines.

 

Here is the abstract. A lot of ISP's and other hosting providers use
mod_vhost_alias and VirtualDocumentRoot directive to provide effective
configuration of virtual hosts.

 

The problem comes in, when you would like to provide separate log per
virtual host. With access log it could be easily done via log pipe: we can
add %v variable and pass it along to some script or application, which will
put the log line to virtual host log file.

 

But error log is more tricky - there is no information about virtual host at
all, so error log piping gives no ability to understand the vhost, which
caused the error.

 

Sure, information in error log is not always connected to any virtual host,
it could be just some information like "Whoa, I've just started" or smth
else. But there is a code, which checks whether there is request or even
connection (lines 912 and 918 in log.c)

 

So will it be reasonable to add [vhost: %s] section to error log string? Of
we have info->r, we have the Host header value or host name for sure there.

 

Cheers,

Leo

 

 

 


RE: Error log vhost addition

Posted by Leo Nikolaev <ni...@kasatkina.org>.
Oh, damn, thanks.

Yes, was talking about 2.2, but the ErrorLogFormat is something I've completely missed out in 2.4.

Thanks!

Leo

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Sunday, August 3, 2014 5:01 PM
To: Apache HTTP Server Development List
Subject: Re: Error log vhost addition

On Sun, Aug 3, 2014 at 8:00 AM, Leo Nikolaev <ni...@kasatkina.org> wrote:

> I’d like to propose a small patch to the error log routines.

no attachment?

> So will it be reasonable to add [vhost: %s] section to error log 
> string? Of we have info->r, we have the Host header value or host name for sure there.

http://httpd.apache.org/docs/current/mod/core.html#errorlogformat

If you're asking about 2.2, it's an unlikely change to garner much interest.

--
Eric Covener
covener@gmail.com


Re: Error log vhost addition

Posted by Eric Covener <co...@gmail.com>.
On Sun, Aug 3, 2014 at 8:00 AM, Leo Nikolaev <ni...@kasatkina.org> wrote:

> I’d like to propose a small patch to the error log routines.

no attachment?

> So will it be reasonable to add [vhost: %s] section to error log string? Of
> we have info->r, we have the Host header value or host name for sure there.

http://httpd.apache.org/docs/current/mod/core.html#errorlogformat

If you're asking about 2.2, it's an unlikely change to garner much interest.

-- 
Eric Covener
covener@gmail.com

RE: Error log vhost addition

Posted by Leo Nikolaev <ni...@kasatkina.org>.
There is no separate vhost configuration, when you use mod_vhost_alias and VirtualDocumentRoot – their goal to make *one* configuration file for all the virtual hosts and add new virtual host by just creating a directory to hold it.

 

And Apache needs to open log files at start up, so ErrorLog should be strictly defined at this point, e.g. at start. In mod_vhost_alias you don’t know at start which vhosts you will be serving.

 

Leo

 

From: kumar2000s@gmail.com [mailto:kumar2000s@gmail.com] 
Sent: Sunday, August 3, 2014 4:42 PM
To: dev@httpd.apache.org
Subject: Re: Error log vhost addition

 

you can define error log separately per vhost inside the vhost configuration 

 

On Sun, Aug 3, 2014 at 5:30 PM, Leo Nikolaev <nikolaev@kasatkina.org <ma...@kasatkina.org> > wrote:

Hi,

 

I’d like to propose a small patch to the error log routines.

 

Here is the abstract. A lot of ISP’s and other hosting providers use mod_vhost_alias and VirtualDocumentRoot directive to provide effective configuration of virtual hosts.

 

The problem comes in, when you would like to provide separate log per virtual host. With access log it could be easily done via log pipe: we can add %v variable and pass it along to some script or application, which will put the log line to virtual host log file.

 

But error log is more tricky – there is no information about virtual host at all, so error log piping gives no ability to understand the vhost, which caused the error.

 

Sure, information in error log is not always connected to any virtual host, it could be just some information like “Whoa, I’ve just started” or smth else. But there is a code, which checks whether there is request or even connection (lines 912 and 918 in log.c)

 

So will it be reasonable to add [vhost: %s] section to error log string? Of we have info->r, we have the Host header value or host name for sure there.

 

Cheers,

Leo

 

 

 

 


Re: Error log vhost addition

Posted by ku...@gmail.com.
you can define error log separately per vhost inside the vhost
configuration


On Sun, Aug 3, 2014 at 5:30 PM, Leo Nikolaev <ni...@kasatkina.org> wrote:

> Hi,
>
>
>
> I’d like to propose a small patch to the error log routines.
>
>
>
> Here is the abstract. A lot of ISP’s and other hosting providers use
> mod_vhost_alias and VirtualDocumentRoot directive to provide effective
> configuration of virtual hosts.
>
>
>
> The problem comes in, when you would like to provide separate log per
> virtual host. With access log it could be easily done via log pipe: we can
> add %v variable and pass it along to some script or application, which will
> put the log line to virtual host log file.
>
>
>
> But error log is more tricky – there is no information about virtual host
> at all, so error log piping gives no ability to understand the vhost, which
> caused the error.
>
>
>
> Sure, information in error log is not always connected to any virtual
> host, it could be just some information like “Whoa, I’ve just started” or
> smth else. But there is a code, which checks whether there is request or
> even connection (lines 912 and 918 in log.c)
>
>
>
> So will it be reasonable to add [vhost: %s] section to error log string?
> Of we have info->r, we have the Host header value or host name for sure
> there.
>
>
>
> Cheers,
>
> Leo
>
>
>
>
>
>
>