dsjq62428
2018-10-17 07:57
浏览 40
已采纳

在Symfony 3中禁止弃用警告

I'm currently upgrading from Symfony 2.8 to 3.4 (we use only LTS releases).

There are a lot of deprecations which will need some time to be resolved. In the meantime these messages cost a lot of memory in dev mode (sometimes even leading to OOM errors) and spam the logs (~3 MB per request), so I would like to disable them completely.

So far I found only solutions for the log spam (configure Monolog), but not for the memory problem.

There is NO call to Debug::enable(). Adding the call explicitly with appropriate error reporting level has no effect.

Disabling error_reporting for E_USER_DEPRECATED has no effect.

There is a similar question which got no responses: How to remove the deprecation warnings in Symfony 2.7? (the question is almost 3 years old, so I re-ask)

I investigated the Symfony source, but saw no possibility for changes either, as everything around error handling seems to be static.

图片转代码服务由CSDN问答提供 功能建议

我目前正在从Symfony 2.8升级到3.4(我们只使用LTS版本)。

有很多弃用需要一些时间来解决。 与此同时,这些消息在开发模式下花费了大量内存(有时甚至导致OOM错误)并且垃圾邮件日志(每个请求大约3 MB),所以我想完全禁用它们。

到目前为止,我发现只有垃圾邮件的解决方案(配置Monolog),但没有找到内存问题。

无法调用 Debug :: enable()。 使用适当的错误报告级别显式添加调用无效。

禁用E_USER_DEPRECATED的error_reporting无效。

有一个类似的问题得到了 没有回复:如何删除Symfony 2.7中的弃用警告 ?(这个问题差不多有3年了,所以我再问一下)

我调查了Symfony源码,但也没有看到更改的可能性,因为一切都是围绕错误处理的 似乎是静态的。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongsetan3216 2018-10-25 07:16
    已采纳

    Had to postpone the problem for a few days, then I noticed my mistake: The suggestion from this answer works if you don't mess up the Monolog config: https://stackoverflow.com/a/35779541/10249309

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题