🔴 Laravel
Beginner
What is the Logging system in Laravel?
Answer
Laravel's logging system is built on Monolog and configured via config/logging.php. Log messages with the Log facade using PSR-3 severity levels: Log::emergency(), Log::alert(), Log::critical(), Log::error(), Log::warning(), Log::notice(), Log::info(), Log::debug(). Add context data: Log::info("User logged in", ["user_id" => $user->id]). Channels: stack (combine multiple channels), single (one log file), daily (separate file per day), slack, syslog, errorlog, cloudwatch. Log to a specific channel: Log::channel("slack")->critical("Server is down!"). For production, use a dedicated logging service (Papertrail, Loggly, Sentry).