0.0.6 • Published 4 years ago

@evkj/log4js-kafka-appender v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

程序不摸黑前进!

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