To access the current log file from Forge itself, you can follow these steps:
- SSH into your server using the Forge SSH key.
- Navigate to the storage directory of your Laravel application. Typically, it is located at
/path/to/your/app/storage. - Look for the
logsdirectory within the storage directory. This is where Laravel stores its log files. - Use the
tailcommand to view the contents of the log file. For example, to view the last 10 lines of the log file, you can run the following command:
tail -n 10 /path/to/your/app/storage/logs/laravel.log
This will display the last 10 lines of the log file in your terminal.
If you prefer to access the log file from Forge's web interface, you can create a symbolic link to the log file in your public directory. Here's how you can do it:
- SSH into your server using the Forge SSH key.
- Navigate to your public directory. This is typically located at
/path/to/your/app/public. - Create a symbolic link to the log file using the
lncommand. For example, if your log file is located at/path/to/your/app/storage/logs/laravel.log, you can run the following command:
ln -s /path/to/your/app/storage/logs/laravel.log /path/to/your/app/public/laravel.log
This will create a symbolic link named laravel.log in your public directory, which points to the actual log file. You can now access the log file from your browser by visiting http://your-domain.com/laravel.log.
Note: Make sure to replace /path/to/your/app with the actual path to your Laravel application.