/laravel-logs-ELK

Monitoring Laravel Logs with ELK

Primary LanguagePHP

Laravel ELK Stack

About the project

This repository contains a Docker setup for a Laravel application and Elk Stack.. The Laravel application will log to the storage\logs directory. Filebeat will read the logs and send them to Logstash running in another Docker Compose stack, where you can then configure it to do whatever you want with the logs. these logs from Logstash will save in Elastic, and finally Kibana will read the logs and visualize them

Setup

  1. Clone this repository:
git clone https://github.com/AhmedHdeawy/laravel-logs-ELK.git

cd laravel-logs-ELK
  1. Start Laravel App Docker Compose with the following commands:
cd laravel-app
sail up
  1. Start ELK Stach Docker Compose with the following commands:
cd elk
docker-compose up

Usage

Once the Docker Compose stacks are running, then evenry thing is ready.

Kibana Configuration

open your browser to access Kibana dashboard through http://localhost:5601

Go to Stack Management => Index patterns => Create index pattern

Write the name laravel-* and choose timestamp from Timestamp field dropdown

Finally, from Kibana navigation panel, choose Discover and then select our Index laravel-*.

Congratulations, now you can see your logs and search for your logs

Laravel ELK Stack

License

This code is released under the MIT License.