mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-01 07:49:02 +08:00
add logging on kafka reading
This commit is contained in:
parent
d9b32db8d7
commit
d5149e592e
@ -52,6 +52,7 @@ func runFilerReplicate(cmd *Command, args []string) bool {
|
|||||||
glog.Errorf("receive %s: %+v", key, err)
|
glog.Errorf("receive %s: %+v", key, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
glog.V(1).Infof("processing file: %s", key)
|
||||||
if err = replicator.Replicate(key, m); err != nil {
|
if err = replicator.Replicate(key, m); err != nil {
|
||||||
glog.Errorf("replicate %s: %+v", key, err)
|
glog.Errorf("replicate %s: %+v", key, err)
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,12 @@ func (k *KafkaInput) initialize(hosts []string, topic string) (err error) {
|
|||||||
config := sarama.NewConfig()
|
config := sarama.NewConfig()
|
||||||
config.Consumer.Return.Errors = true
|
config.Consumer.Return.Errors = true
|
||||||
k.consumer, err = sarama.NewConsumer(hosts, config)
|
k.consumer, err = sarama.NewConsumer(hosts, config)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
} else {
|
||||||
|
glog.V(0).Infof("connected to %v", hosts)
|
||||||
|
}
|
||||||
|
|
||||||
k.topic = topic
|
k.topic = topic
|
||||||
k.messageChan = make(chan *sarama.ConsumerMessage, 1)
|
k.messageChan = make(chan *sarama.ConsumerMessage, 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user