阅读 Laravel (PHP) 日志的更好方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31096644/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:51:00  来源:igfitidea点击:

Better way to read Laravel (PHP) Logs

laravellogging

提问by Tushar

I have an Laravel application hosted on Third Party Server. The application is in production and produces many PHP Errors daily based on how users are using it.

我在第三方服务器上托管了一个 Laravel 应用程序。该应用程序正在生产中,每天都会根据用户的使用方式产生许多 PHP 错误。

I want a better way to read the laravel.log file, instead of doing SSH into the Server and reading it through VIM.

我想要一种更好的方式来读取 laravel.log 文件,而不是通过 SSH 进入服务器并通过 VIM 读取它。

Please advice on what are some other better way to read errors on log file.

请提供有关读取日志文件错误的其他更好方法的建议。

回答by Maxim Lanin

You can use this package https://github.com/rap2hpoutre/laravel-log-viewer

你可以使用这个包https://github.com/rap2hpoutre/laravel-log-viewer

I am using it in my project and it's rather useful.

我在我的项目中使用它,它相当有用。

回答by Rashi Goyal

This is not a better way but it depends on the requirement if only query logs or any such small errors has to be checked then Laravel logs are all logged in \storage\logs\Laravel.log You can empty this file and reload the website all the errors will be populated here again.

这不是更好的方法,但它取决于要求,如果只需要检查查询日志或任何此类小错误,则 Laravel 日志都记录在 \storage\logs\Laravel.log 中您可以清空此文件并重新加载网站错误将再次填充在这里。

回答by Akash khan

Laravel Log Readerpackage so simple and easy installation. It also provides JSON API also, so that you can make your own UI if want.

Laravel Log Reader包让安装如此简单易行。它还提供 JSON API,以便您可以根据需要制作自己的 UI。

GitHub: https://github.com/haruncpi/laravel-log-reader

GitHub: https://github.com/haruncpi/laravel-log-reader

Laravel Log Reader Preview

Laravel 日志阅读器预览