Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Logging 如何使用Laravel 4 artisan命令写入日志文件?_Logging_Laravel_Laravel 4_Command_Error Logging - Fatal编程技术网

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)访问应用程序时