PHP code example of williamtome / loki

1. Go to this page and download the library: Download williamtome/loki 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/ */

    

williamtome / loki example snippets


// config/logging.php

'channel' => [
    // outros channels padrão do Laravel...

    'loki' => [
        'driver' => 'custom',
        'level' => env('LOKI_LOGLEVEL', 'info'),
        'via' => Williamtome\Loki\LokiFactory::class,
        'configApi' => [
            'entrypoint' => env('LOKI_ENTRYPOINT', getenv('LOKI_HOST')),
            'globalLabels' => ['job' => env('APP_NAME', 'ProjectName')]
        ]
    ],
]

LOG_CHANNEL=loki