[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: remote log apache2



michal krajcirovic schrieb:
> Hello,
> I have a simple network architecture in which the need to remotely log 
> on apache2. On servers running the same sites for which requests are 
> sent via loadbalancers. And I want to periodically (eg every minute) the 
> logs "send" to a central log server.
> 
> 
> +----------+
> | apache 1 |->---->\
> +----------+        \     +------------+
>                      ---->| log server |
> +----------+        /     +------------+
> | apache 1 |->---->/
> +----------+
> 
> 
> I tried syslog-ng, but not satisfied me too, someone used some other 
> solution that would recommend?

I'd suggest a simple central log server (using rsyslog). And on the
apache host, you log to rsyslog then forwards the message to the rsyslog
server

Configuration on the rsyslog server (/etc/rsyslog.conf)
<snip>
$ModLoad imudp
$UDPServerRun 514
<snip>
local0.* /var/log/apache_host1.log
local1.* /var/log/apache_host2.log

Configuration on the apache host / syslog client
/etc/rsyslog.conf
<snip>
local0.* @192.168.1.1 (ip address of your rsyslog server, choose
facility local1 on your second apache host)
<snip>

apache.conf

ErrorLog syslog:local0
...
CustomLog "|/usr/bin/logger -p local0.info" common

That's it.

See also [1]

hth,
Michael


[1] http://www.devshed.com/c/a/Apache/Logging-in-Apache/3/

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: