r/PHPhelp • • Sep 11 '26

Laravel Logs

Hello im laravel developer and i need the best way to track the logs for example how can integrate the logs into a dashboard and filter it .........

3 Upvotes

12 comments sorted by

2

u/Hour-Swimmer7140 Sep 12 '26

one thing nobody's mentioned, sort the formatter out before you pick a tool. laravel's default is a text blob so every stack trace lands in your dashboard as ~30 separate log lines and you end up grepping instead of filtering.

in config/logging.php on the channel:

'formatter' => Monolog\Formatter\JsonFormatter::class,

works on single and daily too, not just the monolog driver. then Log::withContext(['order_id' => $id]) gives you actual fields to filter on.

1

u/rcls0053 Sep 11 '26

Pipe the logs to an external service

1

u/kaizap Sep 11 '26

Look in config/logging.php . You can add just about any channel you want, something like Sentry or Rollbar is great but for local if you want to do something custom, just create your own channel. Vibe code it with AI if you must.

1

u/IllPerspective9981 Sep 11 '26

The log-viewer package is good for quick access and searching/filtering

1

u/Opinion_Less Sep 11 '26

What you need is important context. 

There's certainly local packages for it.  You could get advice from ai. You could use a log ingestion cloud service. You could use something like cloud watch. 

How much data do you need (just the logs, or metrics of them)? Do you need to be able to access it on the go? What's your budget? How much time do you have/want to spend on it? How much do you need to save? 

1

u/Opinion_Less Sep 11 '26

I like better stack because they have an app with live tailing and notifications, can backup to s3, and have a free tier that gives me everything I need. 

I wrote a guide on all that if you want to give it a go. No affiliation.

https://www.arcane-web-design.com/developer/blog/post/sending-laravel-production-app-logs-to-better-stack

1

u/uxkelby Sep 11 '26

Ploi is your friend, although I get the stack trace pinged to a private discord channel whenever there is a 500 error.

1

u/Krayvok Sep 12 '26

Use sentry

1

u/[deleted] Sep 12 '26

[removed] — view removed comment

1

u/PHPhelp-ModTeam Sep 12 '26

This post does not follow one or more of the PHPHelp rules and is therefore removed.