pip_services3_elasticsearch 1.1.0 copy "pip_services3_elasticsearch: ^1.1.0" to clipboard
pip_services3_elasticsearch: ^1.1.0 copied to clipboard

This component library is a part of the [Pip.Services](https://github.com/pip-services/pip-services) project. It contains the ElasticSearch logger.

Pip.Services Logo
ElasticSearch components for Dart #

This module is a part of the Pip.Services polyglot microservices toolkit.

The Elasticsearch module contains logging components with data storage on the Elasticsearch server.

The module contains the following packages:

  • Build - contains a factory for the construction of components
  • Log - Logging components

Quick links:

Use #

Add this to your package's pubspec.yaml file:

dependencies:
  pip_services3_elasticsearch: version

Now you can install package from the command line:

pub get

Microservice components shall perform logging usual way using CompositeLogger component. The CompositeLogger will get ElasticSearchLogger from references and will redirect log messages there among other destinations.

class MyComponent implements IConfigurable, IReferenceable {
  CompositeLogger _logger = new CompositeLogger();
  
  configure(ConfigParams config) {
    this._logger.configure(config);
  }
  
  setReferences(IReferences refs) {
    this._logger.setReferences(refs);
  }
  
  myMethod(String? correlationId, param1) {
    this._logger.trace(correlationId, "Executed method mycomponent.mymethod");
    ....
  }
}

Configuration for your microservice that includes ElasticSearch logger may look the following way.

...
{{#if ELASTICSEARCH_ENABLED}}
- descriptor: pip-services:logger:elasticsearch:default:1.0
  connection:
    uri: {{{ELASTICSEARCG_SERVICE_URI}}}
    host: {{{ELASTICSEARCH_SERVICE_HOST}}}{{#unless ELASTICSEARCH_SERVICE_HOST}}localhost{{/unless}}
    port: {{ELASTICSEARCG_SERVICE_PORT}}{{#unless ELASTICSEARCH_SERVICE_PORT}}9200{{/unless}}\ 
{{/if}}
...

Develop #

For development you shall install the following prerequisites:

  • Dart SDK 2
  • Visual Studio Code or another IDE of your choice
  • Docker

Install dependencies:

pub get

Run automated tests:

pub run test

Generate API documentation:

./docgen.ps1

Before committing changes run dockerized build and test as:

./build.ps1
./test.ps1
./clear.ps1

Contacts #

The library is created and maintained by

  • Sergey Seroukhov
  • Levichev Dmitry

The documentation is written by:

  • Mark Makarychev
  • Levichev Dmitry
0
likes
115
pub points
0%
popularity

Publisher

verified publisherentinco.com

This component library is a part of the [Pip.Services](https://github.com/pip-services/pip-services) project. It contains the ElasticSearch logger.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

elastic_client, intl, pip_services3_commons, pip_services3_components, pip_services3_rpc

More

Packages that depend on pip_services3_elasticsearch