Configuring (and viewing!) logs in Laravel

preview_player
Показать описание
In this video, I explore the various ways to configure logging in your Laravel application, from simple file-based logging to more advanced tools like Laravel Telescope, Sentry, and more. Whether you're debugging locally or tracking errors in production, Laravel's flexible logging system has you covered with multiple drivers and configurations to fit your needs.

Featured in this episode:

Follow me:

Chapters:
00:00 - Introduction to Laravel Logging
00:26 - Basic File Logging Setup
01:05 - Understanding Log Channels and Configuration
02:57 - Setting Log Levels and Channel Types
03:50 - Viewing Logs in a File
04:31 - Using Tail Command to Follow Logs
05:15 - Installing and Using Laravel Pail for Log Viewing
06:04 - Creating an Error Log Example
06:57 - Reviewing Other Logging Options - Telescope, Ray
09:42 - Configuring Stack Log Channels
10:40 - Sentry Log Channel
10:57 - How to Combine Multiple Log Channels in a Stack
12:10 - Final Thoughts on Logging Configuration in Laravel
Рекомендации по теме
Комментарии
Автор

"Kill'em with kindness"

Love you man, best tech bro ever!

unseriousdev
Автор

Laravel looks very user-friendly and complete.
They have everything!

As a Python developer, I wish more stuff like that was available in Django out of the box.

Enjoyed the video!

senpos
Автор

I clicked "Do not recommend channel" on theo and friends years ago, I totally recommend this.

lotfiabdallah
Автор

At our firm we've found that Sentry is great for exception reporting. It should NOT, however, be used for *direct* logging using the Log channel. Log events are never as rich as exceptions, but they'll show up as their own event anyway, indistinguishable from exception events until you drill into them. It is better, in our experience, to stick with Sentry's default behavior where logs written prior to an exception will be reported *within* the exception event as breadcrumbs.

I'd love to see a video from you on open-source browser-based log viewers, or how to aggregate logs from multiple apps. Good content as always, sir!

mikechurvis
Автор

Last week I was looking for a nice way to see my logs and I didn’t know anything about pail. Thanks!!! It is just what I needed ❤

soyarenamovediza
Автор

Thanks, I needed this one. Coming from a different ecosystem I struggled to find all the feedback that I am use to.

And I definitely read through the doc on log stacks and got a bit overwhelmed 😅

carlhostetler
Автор

I think the best tool for Log is Sentry... a really powerful extension and service...
Thank you Aaron for share!

Trance_Code
Автор

Very helpful! Personally I use Sentry and daily logs in production and it works really well.

theneverything
Автор

This is a very good video. Atleast after all this twitter drama I got to know about Laravel Pail and the log channels today. Some drama driven learning going on here. Really unfortunate that I saw lots of people in Theo's stream immediatly justifying staying away from such an extensive feature set, just because somebody else is angry. Coming from Django world where I wrote a blog on how to do loggin right and its still one of my most read blogs in medium because its that confusing. I can immediatly see the benifits of Laravel's logging setup. It fulfills all the needs that I have faced till now in my projects in Django.

SiddharthPant
Автор

and now, back to our regularly scheduled programming

etherbeans
Автор

tail might be uninspired, but it works.
For a more inspired and cross-app log viewer, there's also lnav

globiws
Автор

Great video! You mentioned that Ray can only be used to debug locally. While that sure is easy, they also suppport SSH connections to remote servers.

Frank-ounr
Автор

Hello Aaron, I love your laravel videos.
I am also a laravel developer, and would request you to please cover Jobs and Queues in Laravel in a multi-tenant application in details using database and AWS SQS driver.
I have tried many ways to make things work but it seems whenever I change DB inside a JOB, there is some null exception error from JOB class.
Also the bus (Batch Job processing), dont update the in_progress, error etc status, when I switch DB from a Job Class, lets say SendEmailViaJob.
Basically I have multiple DBs and I have to switch to a specific DB (whose information is in payload of JOB) and do the processing in that DB, and then change the DB to a base db.

Hope you find this topic interesting, and cover it, so that we can apply what is the standard way.

curious.coder.X
Автор

Thank you show that Laravel is best option! :)

JonathanAlexeyPereiraFontes
Автор

@Aaron, looks like your audio is a smidge out of sync with the video on this one. I don’t mind it much since your content is always top notch!

islandblaze
Автор

Great video!

If you use laravel sail (or any other docker setup for dev) you can also use the "stderr" log driver/output to log everything to the terminal inside the docker container, this is what i use if i work with sail. wont look as nice as pail though.

Another interesting alternative to sentry i can recommend is glitchtip, may not have that many features but a lot less resource requirements and is also fully opensource.

JustPlayerDE
Автор

You may need to set the correct permissions on the file and parent folder as well.. I usually always run into permission issues.

underflowexception
Автор

I like to put my logs into json formatter and then pipe the tail in jq .

jimblonde
Автор

as always awesome video!!!.
here is an idea for a video - automatic API documentation with tools like dedoc/scramble

RobertoDuransh
Автор

I knew that this reactjs youtuber would only bring trouble

MrNichuya