Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@debugr/elastic-handler

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@debugr/elastic-handler

Elastic log handler for debugr

npmnpm
Version
3.0.0-rc.2
Version published
Weekly downloads
5
-37.5%
Maintainers
2
Weekly downloads
 
Created
Source

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',
};

// There are all dependent formatters checked and validated.
const debugr = Debugr.create(globalContext, 
  [
    ElasticLogHandler.create(
      {
        threshold: LogLevel.TRACE,
        index: 'stringOrFunction',
        // optional arguments:
        // errorCallback
        // bodyMapper
        // errorMsThreshold
      },
    ),
  ],
  [
    ApolloLogger.create(),
    // No formatters are needed for ElasticLogHandler
  ],
);

const server = new ApolloServer({
  // typeDefs, resolvers, ...
  plugins: [
    debugr.getPlugin('apollo'),
  ],
});

FAQs

Package last updated on 24 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts