1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 00:40:06 +01:00

Adds the option to view the Caddy access- and error-log using 'valet server-log'

This commit is contained in:
Jan Willem Kaper
2016-06-15 22:57:58 +02:00
parent d4e71e51db
commit 4fc1acb7c4
4 changed files with 62 additions and 0 deletions

View File

@@ -172,6 +172,23 @@
}
})->descriptions('Stream all of the logs for all Laravel sites registered with Valet');
/**
* Stream Caddy access- and error-log.
*/
$app->command('server-log', function () {
$files = Filesystem::scandir(VALET_HOME_PATH.'/Log');
$files = collect($files)->transform(function ($file) {
return escapeshellarg(VALET_HOME_PATH.'/Log/'.$file);
})->all();
if (count($files) > 0) {
passthru('tail -f '.implode(' ', $files));
} else {
warning('No log files were found.');
}
})->descriptions('Stream Caddy access- and error-log.');
/**
* Display all of the registered paths.
*/