简体   繁体   English

Symfony 2:禁用独白

[英]Symfony 2: Disable Monolog

Is it possible to disable core bundles of Symfony 2, such as the Monolog logger?是否可以禁用 Symfony 2 的核心包,例如 Monolog 记录器?

I am working on an application which doesn't have many fancy requirements except that it should be ultra fast and as much lightweight as possible.我正在开发一个没有太多花哨要求的应用程序,除了它应该超快和尽可能轻量级。 I guess Symfony 2 is not the best framework to go with in my situation, but for me it uses the best principles there are, it is a pleasure to work with and also there are many bundles I might take advantage of later on.我猜 Symfony 2 在我的情况下不是 go 的最佳框架,但对我来说它使用了现有的最佳原则,使用起来很愉快,而且我以后可能会利用许多捆绑包。

So, my question is as in the title, is it possible to completely disable logging (in the production environment at least), and if it is, would it be possible to disable other such features as well?所以,我的问题如标题所示,是否可以完全禁用日志记录(至少在生产环境中),如果可以,是否也可以禁用其他此类功能?

PS: I understand that the easiest and cleanest way to disable a bundle is to remove it from the kernel, but what happens with the code which uses it? PS:我知道禁用捆绑包的最简单和最干净的方法是将其从 kernel 中删除,但是使用它的代码会发生什么情况?

Actually, Symfony2 is perfect for what you want.实际上,Symfony2 非常适合您想要的。 As it is a decoupled framework, you can just include the features you want.由于它是一个解耦框架,您可以只包含您想要的功能。 You can disable monolog from config files.您可以从配置文件中禁用独白。

Also, there is Silex , a micro-framework built with Symfony components, designed to be lightweight and fast for relatively small jobs.此外,还有Silex ,这是一个由 Symfony 个组件构建的微框架,旨在为相对较小的工作提供轻量级和快速的服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM