Skip to content

Commit 7ea1d4f

Browse files
committed
frontend, logging request body as debug message
1 parent b94a67d commit 7ea1d4f

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

Sandbox/frontend/frontend.go

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,27 @@
1616
package main
1717

1818
import (
19-
"bufio"
20-
"context"
21-
"encoding/json"
22-
"errors"
23-
"fmt"
24-
"io/ioutil"
25-
"net/http"
26-
"os"
27-
"os/signal"
28-
"strconv"
29-
"strings"
30-
"sync"
31-
"syscall"
32-
"time"
33-
"github.com/apache/thrift/lib/go/thrift"
34-
"github.com/go-redis/redis/v8"
35-
"github.com/google/uuid"
36-
"github.com/knix-microfunctions/knix/Sandbox/frontend/datalayermessage"
37-
"github.com/knix-microfunctions/knix/Sandbox/frontend/datalayerservice"
38-
log "github.com/sirupsen/logrus"
19+
"bufio"
20+
"context"
21+
"encoding/json"
22+
"errors"
23+
"fmt"
24+
"io/ioutil"
25+
"net/http"
26+
"os"
27+
"os/signal"
28+
"strconv"
29+
"strings"
30+
"sync"
31+
"syscall"
32+
"time"
33+
34+
"github.com/apache/thrift/lib/go/thrift"
35+
"github.com/go-redis/redis/v8"
36+
"github.com/google/uuid"
37+
"github.com/knix-microfunctions/knix/Sandbox/frontend/datalayermessage"
38+
"github.com/knix-microfunctions/knix/Sandbox/frontend/datalayerservice"
39+
log "github.com/sirupsen/logrus"
3940
)
4041

4142
type PlainFormatter struct {
@@ -516,6 +517,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
516517
http.Error(w, "Error submitting event to system", http.StatusInternalServerError)
517518
} else {
518519
log.Infof("[Async Request Started] [ExecutionId] [%s]", id)
520+
log.Debugf("[Request Started] [ExecutionId] [%s], [Request body] [%s], [Topic] [%s], [MfnMessage] [%v]", id, msg.Mfnuserdata, topic, msg)
519521
// w.Header().Set("Content-Type", "application/json")
520522
// w.WriteHeader(http.StatusAccepted)
521523
// Create entry and lock to wait on
@@ -547,6 +549,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
547549
} else {
548550
inFlightRequestsCounterChan <- 1
549551
log.Infof("[Request Started] [ExecutionId] [%s]", id)
552+
log.Debugf("[Request Started] [ExecutionId] [%s], [Request body] [%s], [Topic] [%s], [MfnMessage] [%v]", id, msg.Mfnuserdata, topic, msg)
550553
// Wait on Result
551554
c.Wait()
552555
// Marshall result

0 commit comments

Comments
 (0)