Skip to content

SyntaxPhoenix/monolog-opensearch-handler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Stargazers Issues GPLv3 License


Logo

SyntaxPhoenix OpenSearchHandler for Monolog

Table of Contents

  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPLv3 License. See LICENSE for more information.

Contact

@SyntaxPhoenix - [email protected]

Project Link: https://github.com/SyntaxPhoenix/monolog-opensearch-handler

About

A handler for monolog that send logs to opensearch

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%