egg-syslog
v1.1.1
Published
egg syslog
Downloads
4
Readme
egg-syslog
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.