We are going to a deployment setup where we will have many servers, most of which auto-added to the load balancer when the traffic goes up. The trouble with this setup is that if an individual developer needs to tail logs to troubleshoot something, he will have to open a console on each server, which is made complicated by the fact that the developer often doesn't know HOW many servers we might have in function at that time.
If the developer can find all the logs in one server - say our deploy server, then the troubleshooting becomes easier.
Towards this, I was thinking of setting up a push from each FE machine to the deploy server using a cron which will replicate the logs on our deploy server. There are two problems with this approach:
To solve this problem, I am looking at a way to connect error_log, or PEAR Log to send the logs directly to our deploy server, which will log it in real time to it's local locations at /var/log/..
Anybody knows how I can configure this? Or perhaps a service which accomplishes this?
Our servers are all Ubuntu 10.04 LTS and we are running these servers on EC2 instances in AWS. Our PHP version is 5.3.
What you could do is to log into a custom syslog channel which writes into a central logging server.
php.ini
error_log = syslog
syslog-ng.conf on the php boxes
destination php { tcp("10.10.10.10" port(5140)); };
log { source(src); filter(f_php); destination(php); };
This would send all php logging to a box 10.10.10.10
where syslog-ng
is listening on port 5140
.
On your logging box you have to open the port 5140
in the ec2 security group
Here's a good tutorial on how to setup a syslog server
http://praxis.edoceo.com/howto/syslog-ng
EDIT: This of course would also make it possible to log other important log sources of your php boxes to the log server as well.. Thinking of traffic logs, system logs etc. etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With