@evkj/log4js-kafka-appender

0.0.6 • Public • Published

程序不摸黑前进!

TODO

👉对接后端全链路跟踪;

事件有丢失;

单元测试未补全;

代码优化;

对接示例

npm install --save @qianmi/log4js-Kafka-appender --registry=http://registry.npm.qianmi.com

然后在log4js-config.json中追加appender

log4js-config.json 文件;

{
  "appenders": [
    {
      "type": "@qianmi/logservice-node",
      "appName":"xSite",
      "logType":"APP_LOG",
      "logLevel":"INFO",
      "kafkaConfig":{
          "servers":"172.21.4.62:9092",
          "topic":"LOGSTASH_APP_LOG"
      }
  },{
      "type": "console"
    }
  ],
  "logLevel":"INFO"
}

控制台日志打印 alt text

kibana查看日志 alt text

线上配置 alt text `

其他

参考:

https://github.com/log4js-node/log4js-node

Readme

Keywords

Package Sidebar

Install

npm i @evkj/log4js-kafka-appender

Weekly Downloads

0

Version

0.0.6

License

ISC

Unpacked Size

49.6 kB

Total Files

8

Last publish

Collaborators

  • mapleqf