syntaxphoenix / monolog-opensearch-handler
OpenSearch handler for Monolog
Requires
- monolog/monolog: ^3.0.0
- opensearch-project/opensearch-php: ^2.2.0
Requires (Dev)
- phpunit/phpunit: ^10.2.1
This package is auto-updated.
Last update: 2025-03-25 22:00:43 UTC
README
SyntaxPhoenix OpenSearchHandler for Monolog
About The Project
The OpenSearchHandler for monolog adds a handler, that is able to send logs to a OpenSearch instance. If needed it can also get integrated with Symfony. The initial version is forked from geangontijo/monolog-opensearch-handler.
Built With
Usage
$logger = new \Monolog\Logger('application'); $logger->pushHandler(new \SyntaxPhoenix\MonologOpenSearchHandler\OpenSearchHandler( 'http://localhost:9200', 'username', 'password', 'index_name', Level::Debug, \OpenSearch\ClientBuilder::create()->setHosts([ 'http://localhost:9200' ])->build() )); $logger->info('Hello World');
For usage with Symfony configure the handler within your services.yaml:
SyntaxPhoenix\MonologOpenSearchHandler\OpenSearchHandler: arguments: $endpoint: 'opensearch:9200' $index: "index" $username: 'username' $password: 'password' $bubble: true
The handler can then be used within monolog.yaml:
monolog: handlers: main: handler: opensearchhandler opensearchhandler: type: service id: SyntaxPhoenix\MonologOpenSearchHandler\OpenSearchHandler
Installation
composer require syntaxphoenix/monolog-opensearch-handler
Monolog versions
Monolog v1 | Monolog v2 | Monolog v3 | |
---|---|---|---|
monolog-opensearch-handler v1 | ✓ | ||
monolog-opensearch-handler v2 | ✓ |
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the GPLv3 License. See LICENSE
for more information.
Contact
@SyntaxPhoenix - support@syntaxphoenix.com
Project Link: https://github.com/SyntaxPhoenix/monolog-opensearch-handler