TUN-7128: Categorize logs from public hostname locations

Updates the HTTP ingress request log events to have more structured
fields to adapt to streaming logs reporting.
This commit is contained in:
Devin Carr
2023-04-06 11:30:42 -07:00
parent 5d0bb25572
commit 3fd571063e
7 changed files with 199 additions and 79 deletions

View File

@@ -187,7 +187,12 @@ func Run(c *cli.Context) error {
}
// Output all the logs received to stdout
for _, l := range logs.Logs {
fmt.Printf("%s %s %s %s\n", l.Timestamp, l.Level, l.Event, l.Message)
fields, err := json.Marshal(l.Fields)
if err != nil {
fields = []byte("unable to parse fields")
log.Debug().Msgf("unable to parse fields from event %+v", l)
}
fmt.Printf("%s %s %s %s %s\n", l.Time, l.Level, l.Event, l.Message, fields)
}
case management.UnknownServerEventType:
fallthrough