Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ibrahim Gunduz:
Sending Logs From Symfony Applications To GrayLog Through RabbitMQ
Sep 29, 2017 @ 11:17:10

On his Medium.com site ?brahim Gündüz has posted a tutorial showing you how to send logs from Symfony to Graylog via RabbitMQ, making use of backend queues to handle moving log information into the Graylog instance.

Message Queues are indispensable tools of the systems which is under high load. You can split your systems to small pieces and provide communication between each other through message queue services.

If your system happens by many pieces it means you have so many log entries which is coming from multiple application instances in same time. So you should scale your logging system like how you scaled your application also. Otherwise, your application may go down because of your logging system might be bottleneck.

You can use message queue systems to avoid this trouble.

He starts by helping you install the Composer dependencies required for the RabbitMQ interface and defining the configuration in Symfony to make the connection to the queue. With this in place he moves over to the RabbitMQ side and sets up the queue and exchange to handle the incoming log information. He then creates a LoggingTestCommand command to test out sending the logs to the queue and shows the setup of Graylog to read from that queue and pull in the information automatically.

tagged: symfony tutorial rabbitmq graylog log integration

Link: https://medium.com/@ibrahimgunduz34/sending-logs-from-symfony-applications-to-graylog-through-rabbitmq-4735aebfce4b