Last updated:
0 purchases
pip services4 elasticsearch
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:
Configuration
Logging
Virtual memory configuration
API Reference
Change Log
Get Help
Contribute
Use #
Add this to your package's pubspec.yaml file:
dependencies:
pip_services4_elasticsearch: version
copied to clipboard
Now you can install package from the command line:
pub get
copied to clipboard
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(IContext? context, param1) {
this._logger.trace(context, "Executed method mycomponent.mymethod");
....
}
}
copied to clipboard
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}}
...
copied to clipboard
Develop #
For development you shall install the following prerequisites:
Dart SDK 3
Visual Studio Code or another IDE of your choice
Docker
Install dependencies:
pub get
copied to clipboard
Run automated tests:
pub run test
copied to clipboard
Generate API documentation:
./docgen.ps1
copied to clipboard
Before committing changes run dockerized build and test as:
./build.ps1
./test.ps1
./clear.ps1
copied to clipboard
Contacts #
The library is created and maintained by
Sergey Seroukhov
Levichev Dmitry
The documentation is written by:
Mark Makarychev
Levichev Dmitry
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.