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() {
99
99
100
100
log .Printf ("Listening on: %s" , * listenAddress )
101
101
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
+
102
104
b , err := ioutil .ReadAll (r .Body )
103
105
if err != nil {
104
106
panic (err )
@@ -107,7 +109,14 @@ func main() {
107
109
amo := alertManOut {}
108
110
err = json .Unmarshal (b , & amo )
109
111
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
111
120
}
112
121
113
122
groupedAlerts := make (map [string ][]alertManAlert )
You can’t perform that action at this time.
0 commit comments