【问题标题】:October CMS: Error Log in frontend十月 CMS:前端的错误日志
【发布时间】:2017-11-06 13:27:22
【问题描述】:

当我在服务器上更新我的后端时,可能会发生错误。如果是这样,将显示错误日志。有没有办法隐藏整个世界的所有细节,只显示类似:“发生错误”。对于管理员?

感谢您的帮助。

【问题讨论】:

  • 你是否开启了调试模式?

标签: octobercms


【解决方案1】:

在撰写本文时,October 安装时已关闭调试模式。您应该在生产时启用它。打开 PHP 文件config/app.php 并将调试值更新为false

/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
| You can create a CMS page with route "/error" to set the contents
| of this page. Otherwise a default error page is shown.
|
*/

'debug' => true,

这会将错误转换为通用错误,并由文档推荐。

http://octobercms.com/docs/setup/configuration#debug-mode

重要提示:对于生产环境,始终将 app.debug 设置为 false

【讨论】:

  • 第二句:您应该在生产时禁用它。或者您应该在开发时启用它。
猜你喜欢
  • 2017-02-27
  • 1970-01-01
  • 2018-02-28
  • 1970-01-01
  • 2020-12-18
  • 1970-01-01
  • 2021-12-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多