PHP code example of seguce92 / openobserve-monolog

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

    

seguce92 / openobserve-monolog example snippets


return [
    'channels' => [
        // ...
        "OpenObserve" => \Tasmidur\OpenObserveMonologHandler\OpenObserveLogger::getInstance(
            indexName: env('OPENOBSERVE_INDEX', "app_log"),
            baseUrl: env('OPENOBSERVE_BASE_URL', 'http://admin:admin123@localhost:4080/api')
        ),
    ],
];

return [
    'channels' => [
        // ...
       "OpenObserve" => \Tasmidur\OpenObserveMonologHandler\OpenObserveLogger::getInstance(
            indexName: env('LOG_INDEX', "app_log"),
            baseUrl: env('OPENOBSERVE_BASE_URL', 'http://admin:admin123@localhost:4080/api'),
            options: [
                "is_ssl_verify" => true //true or false
            ]
        ),
    ],
];