func (t *OutputConfig) OutputEvent(ctx context.Context, event logevent.LogEvent) (err error) {
	var host string
	var level int32
	for k, v := range event.Extra {

		lk := strings.ToLower(k)

		if lk == "host" || lk == "hostname" {
			if h, ok := v.(string); ok {
				host = h
			}
			delete(event.Extra, k)
		}

		if lk == "level" {
			if l, ok := v.(int32); ok {
				level = l
			}
			delete(event.Extra, k)
		}
	}

	if len(event.Tags) > 0 {
		event.Extra["tags"] = strings.Join(event.Tags, ", ")
	}

	for _, w := range t.gelfWriters {
		err := w.WriteMessage(
			&SimpleMessage{
				Extra:     event.Extra,
				Host:      host,
				Level:     level,
				Message:   event.Message,
				Timestamp: event.Timestamp,
			},
		)
		if err != nil {
			goglog.Logger.Errorf("outputgelf: %s", err.Error())
			err = t.queue.Queue(ctx, event)
			if err != nil {
				goglog.Logger.Errorf("outputgelf: %s", err.Error())
			}
		}
	}

	return t.queue.Resume(ctx)
}
// OutputEvent handle message from the queue
OutputEvent handle message from the queue
// OutputEvent handle message from the queue
func (t *OutputConfig) OutputEvent(ctx context.Context, event logevent.LogEvent) (err error) {
	var host string
	var level int32
	for k, v := range event.Extra {
		lk := strings.ToLower(k)
		if lk == "host" || lk == "hostname" {
			if h, ok := v.(string); ok {
				host = h
			}
			delete(event.Extra, k)
		}
		if lk == "level" {
			if l, ok := v.(int32); ok {
				level = l
			}
			delete(event.Extra, k)
		}
	}
	if len(event.Tags) > 0 {
		event.Extra["tags"] = strings.Join(event.Tags, ", ")
	}
	for _, w := range t.gelfWriters {
		err := w.WriteMessage(
			&SimpleMessage{
				Extra:     event.Extra,
				Host:      host,
				Level:     level,
				Message:   event.Message,
				Timestamp: event.Timestamp,
			},
		)
		if err != nil {
			goglog.Logger.Errorf("outputgelf: %s", err.Error())
			err = t.queue.Queue(ctx, event)
			if err != nil {
				goglog.Logger.Errorf("outputgelf: %s", err.Error())
			}
		}
	}
	return t.queue.Resume(ctx)
}
func ( t * OutputConfig ) OutputEvent ( ctx context . Context , event logevent . LogEvent ) ( err error ) { var host string var level int32 for k , v := range event . Extra { lk := strings . ToLower ( k ) if lk == " " || lk == " " { if h , ok := v . ( string ) ; ok { host = h } delete ( event . Extra , k ) } if lk == " " { if l , ok := v . ( int32 ) ; ok { level = l } delete ( event . Extra , k ) } } if len ( event . Tags ) > 0 { event . Extra [ " " ] = strings . Join ( event . Tags , " " ) } for _ , w := range t . gelfWriters { err := w . WriteMessage ( & SimpleMessage { Extra : event . Extra , Host : host , Level : level , Message : event . Message , Timestamp : event . Timestamp , } , ) if err != nil { goglog . Logger . Errorf ( " " , err . Error ( ) ) err = t . queue . Queue ( ctx , event ) if err != nil { goglog . Logger . Errorf ( " " , err . Error ( ) ) } } } return t . queue . Resume ( ctx ) }
OutputEvent handle message from the queue
OutputEvent handle message from the queue