【发布时间】:2015-07-03 10:57:13
【问题描述】:
我正在通过ConsoleOuput 打印一些行。我喜欢使用 Table Helper,但它默认使用 StdOut,这似乎是硬编码的,就像在 \Symfony/Component/Console/Output/ConsoleOutput.php 中一样,它说:
* This class is a convenient wrapper around `StreamOutput`.
*
* $output = new ConsoleOutput();
*
* This is equivalent to:
*
* $output = new StreamOutput(fopen('php://stdout', 'w'));
在项目中,我们有 Log4Php,并通过将默认输出从 stdout 更改为自定义输出将其存储到文件中。
有没有办法将 ConsoleOutput 的输出更改为 sdtout 以外的其他内容?
因为到目前为止,我可以在StdOut中看到命令行中的输出,但是当php4log输出重定向到文件时,ConsoleOutput仍然会在StdOut中。
如何将这些输出合并在一起?
【问题讨论】:
标签: php symfony logging console-application