摘要:
使用第三方模块 "github.com/hpcloud/tail" 初始化Tail指针 package logtail import ( "fmt" "github.com/hpcloud/tail" ) var ( tailObj *tail.Tail ) func Init(path strin 阅读全文
摘要:
依赖第三方包 "github.com/Shopify/sarama" 1.初始化异步生产者对象 package kafka import ( "fmt" "github.com/Shopify/sarama" ) var ( producer sarama.AsyncProducer ) func 阅读全文
摘要:
1.解析ini配置文件 config.ini [kafka] address=127.0.0.1:9092 topic=web_log [logtail] path=./my.log 对应的结构体 package conf type KafkaConfig struct { Address []st 阅读全文