seguce92 / openobserve-monolog by seguce92

Open Observe Monolog Handler is used for pushing laravel log into the OpenObserve for collection and analysis.
5
0
1
Package Data
Maintainer Username: seguce92
Maintainer Contact: sgcruz@squadti.com (Sergio G. Cruz Espinoza)
Package Create Date: 2024-06-02
Package Last Update: 2024-06-02
Language: PHP
License: MIT
Last Refreshed: 2024-12-19 15:00:04
Package Statistics
Total Downloads: 5
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Open Observe Monolog Handler

Searching for logs for your applications can be tedious and challenging. OpenObserve solves the problem very elegantly. You can use standard log forwarders like fluentd, fluent-bit, vector, syslog-ng or others to forward logs to OpenObserve. OpenObserve can then store the indexed logs in S3 or on disk and provide fast search for your logs.

OpenObserve Monolog Handler is used for pushing laravel log into the OpenObserve for collection and analysis.

Log forwarders can read the log files incrementally as new logs appear in them and can then forward them in batches in order to be more efficient in sending them.

Install

Install openobserve-monolog.

composer require seguce92/openobserve-monolog

Get Started

1.Modify config/logging.php.

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

OpenObserve with SSL_VERIFY

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
            ]
        ),
    ],
];

2.Modify .env.

LOG_CHANNEL=OpenObserve
OPENOBSERVE_INDEX=zinc_log
OPENOBSERVE_BASE_URL=url

License

MIT