所以我有一个 Laravel Controller :
class YeahMyController extends BaseController {
public function getSomething() {
Console::info('mymessage'); // <-- what do I put here?
return 'yeahoutputthistotheresponse';
}
}
目前,我正在使用 artisan(在后台运行 PHP 的内置开发 Web 服务器)运行应用程序:
php artisan serve
我想将控制台消息记录到 artisan 进程的 STDOUT
管道。
最佳答案
啊哈!
这可以通过以下 PHP 函数完成:
error_log('Some message here.');
关于php - 如何从 Laravel Controller 写入控制台?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25148662/