日志位于哪里? [英] Where are logs located?

查看:118
本文介绍了日志位于哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调试JSON端点,需要查看内部服务器错误.但是,我的app/storage/logs目录为空,并且似乎没有其他目录专用于项目中的日志.我尝试搜索该主题无济于事.

I'm debugging a JSON endpoint and need to view internal server errors. However, my app/storage/logs dir is empty and it seems there are no other directories dedicated to logs in the project. I've tried googling the subject to no avail.

如何启用日志记录(如果尚未启用)并查看日志?

How can I enable logging, if it's not already enabled and view the logs?

推荐答案

  • 确保打开调试模式-将APP_DEBUG=true添加到.env文件或设置环境变量

    • Ensure debug mode is on - either add APP_DEBUG=true to .env file or set an environment variable

      日志文件位于storage/logs文件夹中. laravel.log是默认文件名.如果日志文件夹存在权限问题,Laravel会暂停.因此,如果您的端点正常工作-权限就不成问题了.

      Log files are in storage/logs folder. laravel.log is the default filename. If there is a permission issue with the log folder, Laravel just halts. So if your endpoint generally works - permissions are not an issue.

      如果您的呼叫甚至没有到达Laravel或不是由代码问题引起的,请检查Web服务器的日志文件(检查您的Apache/nginx配置文件以查看路径).

      In case your calls don't even reach Laravel or aren't caused by code issues - check web server's log files (check your Apache/nginx config files to see the paths).

      如果您使用PHP-FPM,请同时检查其日志文件(您可以在PHP-FPM池配置中查看日志文件的路径).

      If you use PHP-FPM, check its log files as well (you can see the path to log file in PHP-FPM pool config).

      这篇关于日志位于哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆