func (t *testEdgeLogger) Log(e *spade.Event) error {
	logLine, err := spade.Marshal(e)
	if err != nil {
		return err
	}
	t.events = append(t.events, logLine)
	return nil
}
Example #2
0
// Sends a spade Event to kafka.
func (l *KafkaLogger) Log(e *spade.Event) error {
	c, err := spade.Marshal(e)
	if err != nil {
		return err
	}
	hystrix.Go(hystrixCommandName, func() error {
		return l.Producer.SendMessage(sarama.StringEncoder(e.Uuid), sarama.ByteEncoder(c))
	}, nil)
	return nil
}
Example #3
0
func (a *EventLoggers) Log(event *spade.Event) error {
	a.AuditLogger.Log("%s", auditTrail(event))

	logLine, err := spade.Marshal(event)
	if err != nil {
		return err
	}
	a.SpadeLogger.Log("%s", logLine)
	a.KLogger.Log(event)
	return nil
}