krzysztofzylka/open-observe

OpenObserve PHP Library

1.0 2024-03-15 19:24 UTC

This package is auto-updated.

Last update: 2024-05-15 19:55:24 UTC


README

Configure

\Krzysztofzylka\OpenObserve\OpenObserve::$USERNAME = '';
\Krzysztofzylka\OpenObserve\OpenObserve::$PASSWORD = '';
\Krzysztofzylka\OpenObserve\OpenObserve::$HOST = 'http://127.0.0.1:5080';
\Krzysztofzylka\OpenObserve\OpenObserve::$STREAM = 'default';
\Krzysztofzylka\OpenObserve\OpenObserve::$ORGANIZATION = 'default';
\Krzysztofzylka\OpenObserve\OpenObserve::$SSLVERIFYPEER = false;

Send log

public static function send(
    string $message,
    string $level = 'INFO',
    array $data = []
)

Example

\Krzysztofzylka\OpenObserve\OpenObserve::send(
    'message',
    'INFO',
    ['additional' => 'data']
)

Log:

{"_timestamp":1710530478602382,"additional":"data","level":"INFO","message":"message"}