How can i get logs of laravel in docker behind php-fpm?

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company
# How Can I Get Logs of Laravel in Docker Behind PHP-FPM? A Deep Dive into Application Logging As a senior developer working with containerized applications, dealing with application logging—especially within complex setups like Nginx, PHP-FPM, and Laravel running in Docker—often presents unique challenges. Developing locally, you see errors immediately; deploying to Docker environments requires a systematic approach to ensure those runtime logs are captured, persisted, and easily accessible. Many developers, including those setting up the architecture you described (Nginx -> PHP-FPM with Laravel), run into the frustration of seeing generic PHP-FPM access and error logs, but missing the crucial application-specific errors generated by the framework itself. This post will walk you through the architecture, diagnose the logging problem, and provide robust solutions to ensure your Laravel application logs are visible within your Docker environment. ## Understanding the Architecture and the Logging Disconnect Your setup involves a standard high-performance stack: `nginx` acting as the web server, routing requests to `php-fpm`, which executes the PHP code (Laravel), and handles the output. The core problem isn't that the logs don't exist; they exist, but they are separated into different layers: 1. **Web Server Logs (Nginx/Access Log):** Tracks HTTP requests served. 2. **PHP-FPM Logs (`error.log`):** Tracks PHP execution errors generated by the FPM process itself. These often capture fatal errors or configuration issues within the