Can Laravel 4 log to a MySQL database?
问题 If so how can it be done? By default L4 writes to a text file. I notice that Monolog can Log to Database on its github page. 回答1: Yep, You could create a listener to log everything in the routes.php Event::listen('laravel.log', function($type,$message) { $log = new Log(); $log->message = $message; $log->type = $type; $log->update; }); Or alternatively if you wanted to only log errors 400 and 500 Larvavel there is a Log event in the Routes.php file which listens to errors 404 and 500, you can