[syslog-ng] Apache vhost logs

Josu Lazkano josu.lazkano at barcelonamedia.org
Wed Jul 13 11:49:04 CEST 2011


Hello again, I configure on the client side some vhost log files this way:

$ cat syslog-ng.conf
options {
        log_fifo_size(2048);
        create_dirs(yes);
        group(adm);
        perm(0640);
        dir_perm(0755);
        use_dns(yes);
        stats_freq(0);
        bad_hostname("^gconfd$");
};

source s_all {
        internal();
        unix-stream("/dev/log");
        file("/proc/kmsg");
        file("/var/www/domain1/log/access.log");
        file("/var/www/domain2/log/access.log");
        file("/var/www/domain3/log/access.log");
        file("/var/www/domain4/log/access.log");
};

destination logserver {
        tcp("logserver");
};

log {
        source(s_all);
        destination(logserver);
};

With this configuration I don't get all access.log info, I put on the same screen a tail -f with a local access.log and user log on the logserver and on the vhost file there is more info. Is this configuration correct?

Sorry for all those newby questions.

Thanks for all your help and best regards.


-----Mensaje original-----
De: syslog-ng-bounces at lists.balabit.hu [mailto:syslog-ng-bounces at lists.balabit.hu] En nombre de Martin Schütte
Enviado el: lunes, 11 de julio de 2011 21:06
Para: Syslog-ng users' and developers' mailing list
Asunto: Re: [syslog-ng] Apache vhost logs

On 07/11/11 10:14, Josu Lazkano wrote:
> I have lots of vhost on the client-side. How could I configure it?

I find it preferable to have Apache log to syslog in the first place,
e.g. with:
CustomLog "||/usr/bin/logger -p local2.info -t apache" combined
ErrorLog "||/usr/bin/logger -p local3.info -t apache"

I use a custom log format to include a VHost field in access log lines
(and later split them as needed). If you need seperate error logs as
well, then it is probably best to include the VHost name in the
tag/programname field.

-- 
Martin
______________________________________________________________________________
Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng
FAQ: http://www.balabit.com/wiki/syslog-ng-faq



More information about the syslog-ng mailing list