PHP code example of spatie / laravel-tail

1. Go to this page and download the library: Download spatie/laravel-tail library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

spatie / laravel-tail example snippets


return [
    'production' => [
        
        /*
         * The host that contains your logs.
         */
        'host' => env('TAIL_HOST_PRODUCTION', ''),

        /*
         * The user to be used to SSH to the server.
         */
        'user' => env('TAIL_USER_PRODUCTION', ''),

        /*
         * The path to the directory that contains your logs.
         */
        'log_directory' => env('TAIL_LOG_DIRECTORY_PRODUCTION', ''),

        /*
         * The filename of the log file that you want to tail.
         * Leave null to let the package automatically select the file.
         */
        'file' => env('TAIL_LOG_FILE_PRODUCTION', null),
        
    ],
];
bash
php artisan tail
bash
php artisan tail production
bash
php artisan vendor:publish --provider="Spatie\Tail\TailServiceProvider"
bash
php artisan tail
bash
php artisan tail --lines=50
bash
php artisan tail --clear
bash
php artisan tail production