Logging 如何使用Laravel 4 artisan命令写入日志文件?
下面的代码提取我要查找的数据,并将其转储到命令行,但不会写入日志文件。。。我该怎么做有什么线索吗Logging 如何使用Laravel 4 artisan命令写入日志文件?,logging,laravel,laravel-4,command,error-logging,Logging,Laravel,Laravel 4,Command,Error Logging,下面的代码提取我要查找的数据,并将其转储到命令行,但不会写入日志文件。。。我该怎么做有什么线索吗 public function fire() { Log::info('Starting Pull', array('Start Pull' => 'Begin'); $this->line('Pulling Data From Source.'); $sites=Site::all(); foreach($sites as $site){ Log::info('Doin
public function fire()
{
Log::info('Starting Pull', array('Start Pull' => 'Begin');
$this->line('Pulling Data From Source.');
$sites=Site::all();
foreach($sites as $site){
Log::info('Doing Pull for', array('data Pull' => print_r($site->tag,true)));
}
$this->line('Completed');
Log::info('End Pull', array('End Pull' => 'Done');
}
你确定你看的是正确的日志吗 Laravel 4添加了用于运行它的服务器API('php_sapi_name()')。因此,如果您使用的是Apache 2,您应该会看到名为:
log-apache2handler-YYYY-MM-DD.txt
通过web界面访问应用程序时;及
log-cli-YYYY-MM-DD.txt
通过命令行界面(即Artisan)访问应用程序时