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:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user