Skip to content

pidofme/log4js-sls-appender

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

log4js-sls-appender

This is a aliyun simple log service appender for log4js.

#Installation

npm install log4js-sls --save

#Configuration

/config/logTest.json

"appenders": {
  "type": "log4js-sls",
  "layout": {
    "type": "pattern",
    "pattern": "%p %c %m"
  },
  "aliyunKey":"aliyunKey",
  "aliyunSecret":"aliyunSecrect",
  "endpoint":"http://cn-hangzhou.sls.aliyuncs.com",
  "slsProject":"porjectname",
  "logStoreName":"logStoreName",
  "topic":"",
  "category": "test"
}

most configure option is setting for aliyun sdk's js.

#Code example:

var log4js = require('log4js');
log4js.configure("./config/logTest.json");
var logger=log4js.getLogger("test");
logger.info("hello");

About

a aliyun sls appender for log4js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%