laravel / pail

Dive into your Laravel application's log files directly from the console. 🪣
MIT License
703 stars 20 forks source link

Infinite loop (follow up) #40

Closed gjm closed 5 hours ago

gjm commented 6 hours ago

I think I've made clear what the issue was. No question on a community support forum will solve my problem.

Right now the issue is in Pail (or Laravel itself). The issue occurs because I trigger logging while loading the authenticated user which, in turn, tries loading the authenticated user which triggers logging... and so on.

The call stack is something like this (assuming SessionGuard is used):

  1. call Auth::id()
  2. call SessionGuard::user()
  3. call UserProvider::retrieveById() to get the user from database
  4. UserProvider triggers logging
  5. Pail logging handler calls Auth::id() to get the username
  6. Goto 1

If you answer me that I shouldn't log in UserProvider I'll accept that answer, even though I don't agree with it, but right now I feel there is an issue. Maybe the issue is in Laravel's auth stack itself...

Will gladly provide any additional info if needed.

Thanks again.

Originally posted by @gjm in https://github.com/laravel/pail/issues/39#issuecomment-2365154390

crynobone commented 5 hours ago

You posted the issue based on Laravel Framework 10 which no longer receiving any bug report. On top of that you are creating custom user provider.

Discussing this on support channel is the right move, otherwise you may submit a PR to improve this.