0

New to Laravel, coming from Rails. In Rails you start the server via rails serve and then begin seeing the server logs (http requests, db queries, etc). How do I see this in Laravel? I'm using Valet so I don't have to run any command to start the server.

nateM
  • 502
  • 4
  • 10
  • 25

1 Answers1

1

The server logs, depend on your valet configuration,

See: Laravel Valet logs

However i think you are looking for the laravel logs, that catch most errors, before sending them to the actual server logs

You'll find these at ./storage/logs in your project. If you didn't set up any different logging method.

Danny Ebbers
  • 919
  • 5
  • 11
  • Thanks Danny. What I'm trying to do is print an object to my console so I can view the data inside it. For example, I have a blog post that I have stored in a $blog variable. I want to view the $blog->title, $blog-author. A little lost on how to do this in Laravel – nateM May 07 '20 at 23:09
  • If you want to log you can use the Log facade, Log::info() dd($blog) to output it (dd == dump and die from laravel) However Log::info(print_r($blog, true)) , would put it in your log – Danny Ebbers May 07 '20 at 23:16
  • using an REPL shell, is also very effective for such stuff, https://github.com/laravel/tinker Or if you are familiar with debugers from other languages xdebug is your friend – Danny Ebbers May 07 '20 at 23:18
  • 1
    This is an awesome answer! Thanks so much. Installing xdebug as we speak. Still curious, in Rails I'm used to seeing the http request type, params, controller action, db query, etc get printed out in my console as the request is happening. Does that not happen in Laravel? – nateM May 07 '20 at 23:41