elastic / call-for-meetups

17 stars 6 forks source link

Supercharge Laravel Application Logs With Elastic Search #38

Closed vrajroham closed 1 year ago

vrajroham commented 1 year ago

Description Laravel is a web application framework with expressive syntax and comes with lots of foundation things pre-packed like complete authentication workflow, testing framework, OAuth2 Server, and many more tempting features. Laravel provides many log storage channels like file, slack, AWS Cloudwatch, and many more.

There can be many scenarios you would like to log the steps in your application. It becomes harder to access and view those logs if you write them to log files or any other channel. It becomes even harder when your application is used at scale.

Laravel provides an easy way to modify the logs on the fly before writing to a file, which we will leverage to convert the logs to JSON format. We will set up the FileBeat agent to inject those logs into elastic search and use the Kibana to draw meaningful information from logs.

Let's take the example of the food aggregator zomato: When the new order is placed, we will push a log about the order with the order number. Now, whatever subsequent changes happen with the order, we will log them along with the order number, E.g. order accepted by restaurant, food was marked ready, rider was assigned etc. If anything goes wrong with order and you as an engineer want to verify what went wrong, all this logs will be super helpful.

Demo with simple application would be good idea to understand the workflow.

Speaker Bio

Senior Product Engineer working at UrbanPiper, Laravel India Speker, Travel Enthusiast, Opensource Contributer. Passionate about scalability and developer experience.

Assign to the Community team