Location of PHP error logs in Laravel Homestead

12,318

I just had this problem too.

Finally I figured out that it was because my custom Laravel code (that I'd downloaded from my Bitbucket repo onto a new computer) included custom code in bootstrap/app.php at the $app->configureMonologUsing line, and I hadn't properly set up a new .env file.

I guess it can be dangerous / fragile to mess with the default logger.

But now that I fixed my .env, the logs correctly appear in /storage/logs/laravel.log.

Share:
12,318
Admin
Author by

Admin

Updated on June 08, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm currently experiencing routing issues, where various pages of my application are returning white pages.

    Where are the PHP logs located within Homestead Vagrant so I can diagnose what's the issue?

    I've checked /var/log/ and I can only see a php7.0-fpm.log that relates to PHP, but nothing is generated within here when I read it.

    • Quynh Nguyen
      Quynh Nguyen over 7 years
      Are you chmod 777 for storage and bootstrap folder?
    • Shoaib Rehan
      Shoaib Rehan over 7 years
      Log file path: laravel root folder/storage/logs/laravel.txt
    • Ryan
      Ryan about 7 years
      I am so disappointed in in Laravel Homestead. Getting it set up has taken me hours, and finally I can see my website in my browser, but I can only see a 500 error page, and I can't find the logs anywhere. Vagrant and Homestead have been a waste of my time so far. I'd love to see what I'm doing wrong.
    • Sabrina Leggett
      Sabrina Leggett about 7 years
      @Ryan Try c9.io next time - Homestead was huge waste of time for me too.
    • agileMike
      agileMike over 4 years
      I know this thread is a couple years old but fwiw I also ran into a few problems with setting up homestead, but it was well worth it. Your Google skills definitely have to be on point.
  • agileMike
    agileMike over 4 years
    This led me to the solution for my problem. I needed to copy the .env.example file to .env and configure my database settings. That cleared the 500 and Laravel told me to generate the app key and nicely provided a button on the page to do so.