@@ -10,10 +10,10 @@ import (
1010
1111 "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/caching"
1212 fevents "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/events"
13- "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/extrafields"
14- "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/logging"
15- "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/sumoCFFirehose" //**
13+ "bitbucket.org/mcplusa-ondemand/firehouse-to-sumologic/sumoCFFirehose"
1614 "github.com/Sirupsen/logrus"
15+ "github.com/cloudfoundry-community/firehose-to-syslog1/extrafields"
16+ "github.com/cloudfoundry-community/firehose-to-syslog1/logging"
1717 "github.com/cloudfoundry/sonde-go/events"
1818)
1919
@@ -23,19 +23,19 @@ type EventRouting struct {
2323 selectedEventsCount map [string ]uint64
2424 mutex * sync.Mutex
2525 sLAppender sumoCFFirehose.SumoCFFirehose //**
26- log logging.Logging
27- ExtraFields map [string ]string
26+ //* log logging.Logging
27+ ExtraFields map [string ]string
2828}
2929
30- func NewEventRouting (caching caching.Caching , logging logging. Logging , sLAppender sumoCFFirehose.SumoCFFirehose ) * EventRouting {
30+ func NewEventRouting (caching caching.Caching , sLAppender sumoCFFirehose.SumoCFFirehose ) * EventRouting {
3131 return & EventRouting {
3232 CachingClient : caching ,
3333 selectedEvents : make (map [string ]bool ),
3434 selectedEventsCount : make (map [string ]uint64 ),
3535 sLAppender : sLAppender , //**
36- log : logging ,
37- mutex : & sync.Mutex {},
38- ExtraFields : make (map [string ]string ),
36+ //* log: logging,
37+ mutex : & sync.Mutex {},
38+ ExtraFields : make (map [string ]string ),
3939 }
4040}
4141
@@ -80,8 +80,10 @@ func (e *EventRouting) RouteEvent(msg *events.Envelope) {
8080 if ignored , hasIgnoredField := event .Fields ["cf_ignored_app" ]; ignored == true && hasIgnoredField {
8181 e .selectedEventsCount ["ignored_app_message" ]++
8282 } else {
83- e .sLAppender .AppendLogs (event .Fields ) //**
84- e .log .ShipEvents (event .Fields , event .Msg ) // here we have to change the method for the one on sumoLogicAppender
83+ /*fmt.Printf("I'm in eventRpouting method .. -------")
84+ fmt.Println(event.Fields)
85+ fmt.Println(event.Msg)*/
86+ e .sLAppender .AppendLogs (event .Fields ) //**/here we have to change the method for the one on sumoLogicAppender
8587 e .selectedEventsCount [eventType .String ()]++
8688
8789 }
@@ -97,7 +99,7 @@ func (e *EventRouting) SetupEventRouting(wantedEvents string) error {
9799 for _ , event := range strings .Split (wantedEvents , "," ) {
98100 if e .isAuthorizedEvent (strings .TrimSpace (event )) {
99101 e .selectedEvents [strings .TrimSpace (event )] = true
100- logging .LogStd (fmt .Sprintf ("Event Type [%s] is included in the fireshose!" , event ), false )
102+ // logging.LogStd(fmt.Sprintf("Event Type [%s] is included in the fireshose!", event), false)
101103 } else {
102104 return fmt .Errorf ("Rejected Event Name [%s] - Valid events: %s" , event , GetListAuthorizedEventEvents ())
103105 }
@@ -159,7 +161,8 @@ func (e *EventRouting) LogEventTotals(logTotalsTime time.Duration) {
159161 startTime = time .Now ()
160162 event , lastCount := e .getEventTotals (totalElapsedTime , elapsedTime , count )
161163 count = lastCount
162- e .log .ShipEvents (event .Fields , event .Msg )
164+ //*e.log.ShipEvents(event.Fields, event.Msg)
165+ e .sLAppender .AppendLogs (event .Fields )
163166 }
164167 }()
165168}
0 commit comments