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.

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

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
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
using an REPL shell, is also very effective for such stuff, github.com/laravel/tinker Or if you are familiar with debugers from other languages xdebug is your friend
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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.