PHP code example of marick / laravel-google-cloud-logging

1. Go to this page and download the library: Download marick/laravel-google-cloud-logging 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/ */

    

marick / laravel-google-cloud-logging example snippets


'google_cloud' => [
    'driver' => 'google_cloud',
    'location' => env('GOOGLE_CLOUD_LOGGING_LOCATION'),
],

use Illuminate\Support\Facades\Log;

Log::debug('user logged in', [
    'user' => 5,
]);

use Illuminate\Support\Facades\Context;
use Illuminate\Support\Facades\Log;

Context::add('user', 5);

Log::alert('user logged in');
dotenv
LOG_CHANNEL=google_cloud