File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ func main() {
9999
100100 log .Printf ("Listening on: %s" , * listenAddress )
101101 http .ListenAndServe (* listenAddress , http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
102+ log .Printf ("%s - [%s] %s" , r .Host , r .Method , r .URL .RawPath )
103+
102104 b , err := ioutil .ReadAll (r .Body )
103105 if err != nil {
104106 panic (err )
@@ -107,7 +109,14 @@ func main() {
107109 amo := alertManOut {}
108110 err = json .Unmarshal (b , & amo )
109111 if err != nil {
110- panic (err )
112+ if len (b ) > 1024 {
113+ log .Printf ("Failed to unpack inbound alert request - %s..." , string (b [:1023 ]))
114+
115+ } else {
116+ log .Printf ("Failed to unpack inbound alert request - %s" , string (b ))
117+ }
118+
119+ return
111120 }
112121
113122 groupedAlerts := make (map [string ][]alertManAlert )
You can’t perform that action at this time.
0 commit comments