Skip to content

Commit

Permalink
fix LogsCollector for default daily logs naming convention in L5
Browse files Browse the repository at this point in the history
Laravel 5 defaults to daily log files with the naming convention laravel-2015-04-08.log. updated getLogsFile() method to play nice with this change and default to the daily logs while falling back to the single file logs.
  • Loading branch information
unitedworx committed Apr 8, 2015
1 parent 007534b commit 2beb96b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DataCollector/LogsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public function __construct($path = null, $name = 'logs')
*/
public function getLogsFile()
{
//Default log location (single file)
$path = storage_path() . '/logs/laravel.log';

//Rotating logs (Laravel 4.0)
// default daily rotating logs (Laravel 5.0)
$path = storage_path() . '/logs/laravel-' . date('Y-m-d') . '.log';
// single file logs
if (!file_exists($path)) {
$path = storage_path() . '/logs/log-' . php_sapi_name() . '-' . date('Y-m-d') . '.txt';
$path = storage_path() . '/logs/laravel.log';
}

return $path;
}

Expand Down

0 comments on commit 2beb96b

Please sign in to comment.