egg-syslog
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

egg-syslog

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

Install

$ npm i egg-syslog --save

Usage

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

Configuration

// {app_root}/config/config.default.js
exports.syslog = {
  appName: 'your-app-name',
  hostName: 'your-host-name',
  host: 'your-host',
  port: 'your-port',
  level: 'INFO',
  aliyun: {
    project: 'your-project-name',
    logstore: 'your-logstore-name',
    accessKeyId: 'accessKeyId',
    accsssKeySecret: 'accsssKeySecret'
  }
};

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

Example

use ctx.logger or app.logger to send msg

// send a info message by info level
ctx.logger.info('message');
// or
app.logger.info('message');

Questions & Suggestions

Please open an issue here.

License

MIT

/egg-syslog/

    Package Sidebar

    Install

    npm i egg-syslog

    Weekly Downloads

    2

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    11.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • wxbing