Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

egg-elk

rockhentai22MIT1.1.0

[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down

egg, eggPlugin, egg-plugin

readme

egg-elk

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Description

egg elk log plugin

Install

$ npm i egg-elk --save

Usage

// {app_root}/config/plugin.js
exports.elk = {
  enable: true,
  package: 'egg-elk',
};

Configuration

type CategoryTypes = 'logger' | 'errorLogger' | 'coreLogger' | 'scheduleLogger';

interface ELKConfig {
  host: string;
  port: number;
  logType?: string;
  categories?: CategoryTypes[];
  tcp?: {
    maxConnections: number;
    retryInterval: number;
    timeout: number;
  };
  fields?: {
    [key: string]: string;
  };
}
Property Description Type Default
host elk host string -
port elk port number -
logType type of your log string -
categories - CategoryTypes[] ['logger']
tcp tcp config - { maxConnections: 300, retryInterval: 500, timeout: 5000 }
fields custom tags { [key: string]: string; } -
// {app_root}/config/config.default.js
exports.elk = {
  host: '127.0.0.1',
  port: 80,
  logType: 'eggElkLogType',
  fields: {
    tag: 'kurt',
  },
  categories: [ 'logger' ],
  tcp: {
    maxConnections: 300,
    retryInterval: 500,
    timeout: 5000,
  },
};

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

1.1.0 (2021-03-29)

Features

  • add pid,paddingMessage,hostname (aa8db74)

Bug Fixes

1.0.1 (2021-03-24)

1.0.0 (2021-03-24)

Features