Elastic Log Handler for Debugr
This LogHandler adds logging to elastic via sdk.
Installation
npm install --save @debugr/elastic-handler
Usage
With standalone Apollo Server:
import { ApolloLogger } from '@debugr/apollo';
import { ApolloServer } from 'apollo-server';
import {
Logger,
Debugr,
LogLevel,
} from '@debugr/core';
import { ElasticLogHandler } from '@debugr/elastic-handler';
const globalContext = {
applicationName: 'example',
};
const debugr = Debugr.create(globalContext,
[
ElasticLogHandler.create(
{
threshold: LogLevel.TRACE,
index: 'stringOrFunction',
},
),
],
[
ApolloLogger.create(),
],
);
const server = new ApolloServer({
plugins: [
debugr.getPlugin('apollo'),
],
});