vhost based syslog logging

vhost based syslog logging

am 16.09.2009 13:17:10 von g.p.t.m.geurts

------_=_NextPart_001_01CA36BF.3C25FB9E
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable


Hello list.=20
I'm configuring syslog for our servers. One of them is a apache
webserver. We've decided to log as much as possible via syslog. For
apache the ErrorLog can go directly to syslog and for CustumLogs I use a
small perl script, logger.pl, that listens for input and logs it to
syslog. This works how it's supposed to but the problem is that for
every vhost we have two CustomLog directives, one for port 80 and one
for port 443. This means we will get allot of scripts running, doing
exacly the same... I thought I could just specify one CustomLog
"|logger.pl" in httpd.conf and filter them again per vhost acording to
the servername using syslog-ng. The problem with this is %v and %V as is
the headerline Host(%{Host}i)are set to the hostname of the machine
serving apache, not the vhost name...
Does anyone know a solution for this problem.


Geert Geurts=20
Universiteit Leiden
Afdeling Middleware
Tel:071-5276873


------_=_NextPart_001_01CA36BF.3C25FB9E
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable




charset=3Dus-ascii">
6.5.7651.53">
vhost based syslog logging






Hello list.


I'm configuring syslog for our =
servers. One of them is a apache webserver. We've decided to log as much =
as possible via syslog. For apache the ErrorLog can go directly to =
syslog and for CustumLogs I use a small perl script, logger.pl,  =
that listens for input and logs it to syslog. This works how it's =
supposed to but the problem is that for every vhost we have two =
CustomLog directives, one for port 80 and one for port 443. This means =
we will get allot of scripts running, doing exacly the same… I =
thought I could just specify one CustomLog "|logger.pl" in =
httpd.conf and filter them again per vhost acording to the servername =
using syslog-ng. The problem with this is %v and %V as is the headerline =
Host(%{Host}i)are set to the hostname of the machine serving apache, not =
the vhost name…



Does anyone know a solution for this =
problem.





Geert  Geurts


Universiteit Leiden


Afdeling Middleware


Tel:071-5276873





------_=_NextPart_001_01CA36BF.3C25FB9E--

Re: vhost based syslog logging

am 17.09.2009 11:44:39 von Matus UHLAR - fantomas

On 16.09.09 13:17, Geurts, G.P.T.M. wrote:
> I'm configuring syslog for our servers. One of them is a apache
> webserver. We've decided to log as much as possible via syslog. For
> apache the ErrorLog can go directly to syslog and for CustumLogs I use a
> small perl script, logger.pl, that listens for input and logs it to
> syslog. This works how it's supposed to but the problem is that for
> every vhost we have two CustomLog directives, one for port 80 and one
> for port 443.

do you really have one vhost on both ports (80 and 443)?
Aren't they really two virtual hosts, one without ssl, one with it?

> This means we will get allot of scripts running, doing
> exacly the same... I thought I could just specify one CustomLog
> "|logger.pl" in httpd.conf and filter them again per vhost acording to
> the servername using syslog-ng.

> The problem with this is %v and %V as is
> the headerline Host(%{Host}i)are set to the hostname of the machine
> serving apache, not the vhost name...

configure UseCanonicalName setting, it affects into what is %V resolved.

I have it turned on (which means, I don't see which hostname was requested,
bad bad mod_log_config!).

I only use one access log for all vhosts, and one for default vhost with
different settings (UseCanonicalName off so it logs requested hostname too).

Don't you se dynamic virtual hosts by any chance?
--
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
There's a long-standing bug relating to the x86 architecture that
allows you to install Windows. -- Matthew D. Fuller

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org