如何导出日志以查看?

时间:2014-12-03 22:33:56

标签: laravel-4

我正在为Laravel 4.1应用程序构建一个管理页面,并希望能够轻松访问日志文件。

我试过了:

Route::get('logs', function() {
    $logfile = storage_path() . '/logs/laravel.log';
    $logs = file_get_contents($logfile);
    return Response::json(array('logs' => $logs));
});

但它会引发以下错误:

{"error":{"type":"UnexpectedValueException","message":"The Response content must be a string or object implementing __toString(), \"boolean\" given.","file":"\/var\/www\/html\/myApp\/vendor\/symfony\/http-foundation\/Symfony\/Component\/HttpFoundation\/Response.php","line":421}}

0 个答案:

没有答案