What is the location of Laravel's error logs?

Stefan Izdrail

Founder & Senior Architect · 2026-06-29

Laravel Company
Title: Understanding Laravel's Error Logging System: Locations, Enabling, and Viewing Introduction: In the ever-evolving world of web development, debugging can be a crucial yet challenging process in ensuring application stability. Laravel, as an MVC framework, provides several features to aid developers in troubleshooting issues. This blog post explores Laravel's error logging system, locating its logs, enabling them if they are not already, and viewing existing log files to help you better debug your applications. 1. Locations of Laravel's Error Log Files: By default, Laravel stores all application logs in the app/storage/logs directory. However, there could be times where the folder is empty, or it might not be the only storage location for logs. It is essential to know about other possible locations and how to access them. a) Laravel 5.x: For applications running on Laravel 5.x versions, there are two main log files within the app/storage/logs directory. One of these is named laravel-debug.log, and the other is called laravel.log. These logs hold different types of data: - The first one, laravel-debug.log, holds stack traces for exceptions raised by applications. This file is usually used when debugging a specific issue or performing detailed troubleshooting. - The second one, laravel.log, serves as the default application log and stores general information about the application's run, including user data, web server logs, and other related events. b) Laravel 6.x onwards: As of Laravel 6.x versions, you will find a single file in app/storage/logs, which is named laravel.log. This log file now stores both general application information and stack traces for exceptions. 2. Enabling Laravel Error Logging: If error logging is not enabled or you cannot locate the log files in your project, follow these steps to enable and configure your error logging system: a) Create a .env File (if None Exists): Navigate to the root of your Laravel application and create a new file named .env if one doesn't exist already. This file contains environment variables for configuring your local development environment. b) Add Logging Configuration: Within the newly created .env file, add the following line for enabling error logging: - For Laravel 5.x versions: APP_LOG_LEVEL=debug - For Laravel 6.x onwards: APP_LOG_CHANNEL=stack (This will store logs in the default file, which is now named laravel.log) 3. Viewing and Managing Existing Log Files: Once you've enabled error logging and located your log files, you can view them using a text editor or command-line tools like nano/vim (depending on your OS) or the built-in PHP command-line interface. Here's how to navigate to your Laravel project directory and open the logs folder: - Unix/Linux/macOS users: cd path/to/laravel_project && cd storage/logs - Open a text editor with root privileges (e.g., sudo nano) or use command-line tools like vim, nano, or open the logs folder using your preferred file manager. - Windows users: cd %laravel_project_path%\storage\logs - Open the logs folder in the File Explorer and double-click to open with a text editor like Notepad, Sublime Text, or Visual Studio Code. Conclusion: Laravel offers an efficient logging system that provides developers with essential information about their applications' performance and errors. By understanding the locations of your error logs, enabling them if necessary, and navigating them using suitable tools, you can effectively troubleshoot your Laravel application. For further insight into Laravel's debugging mechanisms, visit https://laravelcompany.com/blog for our comprehensive guides, tutorials, and best practices on optimizing your web development skills.