1.1.5 • Published 6 years ago
slf4ts-elasticsearch-log-adapter v1.1.5
slf4ts-elasticsearch-log-adapter
elasticsearch client Logging-Adapter for slf4ts
This project is a log adapter using slf4ts logger implementation.
It's meant to be used with nodejs
.
Usage
import { ILoggerInstance, LoggerFactory } from "slf4ts-api";
// create an instance of elasticsearch client and an instance of the logging adapter for that client
// creates/uses a logger with group "elasticsearch"
const client = new Client({ log: new ElasticsearchLogAdapter().newLogger() });
const logger: ILoggerInstance = LoggerFactory.getLogger("my-elasticsearch");
// create an instance of elasticsearch client and an instance of the logging adapter with a pre-created logger instance
const client = new Client({ log: new ElasticsearchLogAdapter().newLogger(logger) });
// access the underlying logger instance
const logger: ILoggerInstance = LoggerFactory.getLogger("elasticsearch");
logger.setLogLevel(...);