diff --git a/bbb-graphql-middleware/internal/hascli/client.go b/bbb-graphql-middleware/internal/hascli/client.go index 072837e352..3c6c681817 100644 --- a/bbb-graphql-middleware/internal/hascli/client.go +++ b/bbb-graphql-middleware/internal/hascli/client.go @@ -29,7 +29,7 @@ func HasuraClient(browserConnection *common.BrowserConnection, cookies []*http.C hasuraConnectionId := "HC" + fmt.Sprintf("%010d", lastHasuraConnectionId) log = log.WithField("hasuraConnectionId", hasuraConnectionId) - defer log.Infof("finished") + defer log.Debugf("finished") // Add sub-protocol var dialOptions websocket.DialOptions @@ -80,7 +80,7 @@ func HasuraClient(browserConnection *common.BrowserConnection, cookies []*http.C thisConnection.Websocket = c // Log the connection success - log.Infof("connected with Hasura") + log.Debugf("connected with Hasura") // Configure the wait group var wg sync.WaitGroup diff --git a/bbb-graphql-middleware/internal/hascli/conn/reader/reader.go b/bbb-graphql-middleware/internal/hascli/conn/reader/reader.go index 7bb5fa0cce..515d131724 100644 --- a/bbb-graphql-middleware/internal/hascli/conn/reader/reader.go +++ b/bbb-graphql-middleware/internal/hascli/conn/reader/reader.go @@ -16,7 +16,7 @@ func HasuraConnectionReader(hc *common.HasuraConnection, fromHasuraToBrowserChan defer wg.Done() defer hc.ContextCancelFunc() - defer log.Info("finished") + defer log.Debugf("finished") for { // Read a message from hasura @@ -50,7 +50,7 @@ func HasuraConnectionReader(hc *common.HasuraConnection, fromHasuraToBrowserChan hc.Browserconn.ActiveSubscriptionsMutex.Lock() delete(hc.Browserconn.ActiveSubscriptions, queryId) hc.Browserconn.ActiveSubscriptionsMutex.Unlock() - log.Infof("Subscription with Id %s finished by Hasura.", queryId) + log.Debugf("Subscription with Id %s finished by Hasura.", queryId) } //Apply msg patch when it supports it diff --git a/bbb-graphql-middleware/internal/hascli/conn/writer/writer.go b/bbb-graphql-middleware/internal/hascli/conn/writer/writer.go index 4d0b9e57a4..3a4b9b7c43 100644 --- a/bbb-graphql-middleware/internal/hascli/conn/writer/writer.go +++ b/bbb-graphql-middleware/internal/hascli/conn/writer/writer.go @@ -21,7 +21,7 @@ func HasuraConnectionWriter(hc *common.HasuraConnection, fromBrowserChannel chan defer wg.Done() defer hc.ContextCancelFunc() - defer log.Infof("finished") + defer log.Debugf("finished") RangeLoop: for { diff --git a/bbb-graphql-middleware/internal/msgpatch/jsonpatch.go b/bbb-graphql-middleware/internal/msgpatch/jsonpatch.go index cbc3c9146c..79823ca6ff 100644 --- a/bbb-graphql-middleware/internal/msgpatch/jsonpatch.go +++ b/bbb-graphql-middleware/internal/msgpatch/jsonpatch.go @@ -47,7 +47,7 @@ func RemoveConnCacheDir(connectionId string) { return } - log.Infof("Directory of patch caches removed successfully for client %s.", connectionId) + log.Debugf("Directory of patch caches removed successfully for client %s.", connectionId) } func RemoveConnSubscriptionCacheFile(bConn *common.BrowserConnection, subscriptionId string) { @@ -61,7 +61,7 @@ func RemoveConnSubscriptionCacheFile(bConn *common.BrowserConnection, subscripti return } - log.Infof("Directory of patch caches removed successfully for client %s, subscription %s.", bConn.Id, subscriptionId) + log.Debugf("Directory of patch caches removed successfully for client %s, subscription %s.", bConn.Id, subscriptionId) } } diff --git a/bbb-graphql-middleware/internal/websrv/connhandler.go b/bbb-graphql-middleware/internal/websrv/connhandler.go index e8c08cdd2b..d1a7254de3 100644 --- a/bbb-graphql-middleware/internal/websrv/connhandler.go +++ b/bbb-graphql-middleware/internal/websrv/connhandler.go @@ -63,10 +63,12 @@ func ConnectionHandler(w http.ResponseWriter, r *http.Request) { BrowserConnectionsMutex.Lock() delete(BrowserConnections, browserConnectionId) BrowserConnectionsMutex.Unlock() + + log.Infof("connection removed") }() // Log it - log.Printf("connection accepted") + log.Infof("connection accepted") // Create channels fromBrowserChannel1 := make(chan interface{}, bufferSize) @@ -75,7 +77,7 @@ func ConnectionHandler(w http.ResponseWriter, r *http.Request) { // Ensure a hasura client is running while the browser is connected go func() { - log.Printf("starting hasura client") + log.Debugf("starting hasura client") BrowserConnectedLoop: for { @@ -84,7 +86,7 @@ func ConnectionHandler(w http.ResponseWriter, r *http.Request) { break BrowserConnectedLoop default: { - log.Printf("creating hasura client") + log.Debugf("creating hasura client") BrowserConnectionsMutex.RLock() thisBrowserConnection := BrowserConnections[browserConnectionId] BrowserConnectionsMutex.RUnlock() diff --git a/bbb-graphql-middleware/internal/websrv/invalidator/invalidator.go b/bbb-graphql-middleware/internal/websrv/invalidator/invalidator.go index 56a29b92e6..5f23e976c0 100644 --- a/bbb-graphql-middleware/internal/websrv/invalidator/invalidator.go +++ b/bbb-graphql-middleware/internal/websrv/invalidator/invalidator.go @@ -48,15 +48,15 @@ func BrowserConnectionInvalidator() { messageCoreAsMap := messageAsMap["core"].(map[string]interface{}) messageBodyAsMap := messageCoreAsMap["body"].(map[string]interface{}) sessionTokenToInvalidate := messageBodyAsMap["sessionToken"] - log.Infof("Received invalidate request for sessionToken %v", sessionTokenToInvalidate) + log.Debugf("Received invalidate request for sessionToken %v", sessionTokenToInvalidate) websrv.BrowserConnectionsMutex.RLock() for _, browserConnection := range websrv.BrowserConnections { if browserConnection.SessionToken == sessionTokenToInvalidate { if browserConnection.HasuraConnection != nil { - log.Infof("Processing invalidate request for sessionToken %v (hasura connection %v)", sessionTokenToInvalidate, browserConnection.HasuraConnection.Id) + log.Debugf("Processing invalidate request for sessionToken %v (hasura connection %v)", sessionTokenToInvalidate, browserConnection.HasuraConnection.Id) browserConnection.HasuraConnection.ContextCancelFunc() - log.Infof("Processed invalidate request for sessionToken %v (hasura connection %v)", sessionTokenToInvalidate, browserConnection.HasuraConnection.Id) + log.Debugf("Processed invalidate request for sessionToken %v (hasura connection %v)", sessionTokenToInvalidate, browserConnection.HasuraConnection.Id) } } } diff --git a/bbb-graphql-middleware/internal/websrv/reader/reader.go b/bbb-graphql-middleware/internal/websrv/reader/reader.go index a679abbe1f..551ddd0904 100644 --- a/bbb-graphql-middleware/internal/websrv/reader/reader.go +++ b/bbb-graphql-middleware/internal/websrv/reader/reader.go @@ -26,7 +26,7 @@ func BrowserConnectionReader(browserConnectionId string, ctx context.Context, c time.Sleep(100 * time.Millisecond) }() - defer log.Infof("finished") + defer log.Debugf("finished") for { ctx, cancel := context.WithCancel(ctx) diff --git a/bbb-graphql-middleware/internal/websrv/sessiontokenreader.go b/bbb-graphql-middleware/internal/websrv/sessiontokenreader.go index bf7a0127a6..97e789c7bd 100644 --- a/bbb-graphql-middleware/internal/websrv/sessiontokenreader.go +++ b/bbb-graphql-middleware/internal/websrv/sessiontokenreader.go @@ -10,7 +10,7 @@ func SessionTokenReader(connectionId string, browserConnectionContext context.Co log := log.WithField("_routine", "SessionTokenReader") defer wg.Done() - defer log.Info("finished") + defer log.Debugf("finished") BrowserConnectionsMutex.RLock() browserConnection := BrowserConnections[connectionId] diff --git a/bbb-graphql-middleware/internal/websrv/writer/writer.go b/bbb-graphql-middleware/internal/websrv/writer/writer.go index f8a2f753b0..75fa65675e 100644 --- a/bbb-graphql-middleware/internal/websrv/writer/writer.go +++ b/bbb-graphql-middleware/internal/websrv/writer/writer.go @@ -13,7 +13,7 @@ func BrowserConnectionWriter(browserConnectionId string, ctx context.Context, c log := log.WithField("_routine", "websocketConnectionWriter").WithField("browserConnectionId", browserConnectionId) defer wg.Done() - defer log.Printf("finished") + defer log.Debugf("finished") RangeLoop: for { diff --git a/bbb-graphql-server/hasura-config.env b/bbb-graphql-server/hasura-config.env index 1c359607eb..725eadbd8a 100644 --- a/bbb-graphql-server/hasura-config.env +++ b/bbb-graphql-server/hasura-config.env @@ -1,6 +1,7 @@ HASURA_GRAPHQL_DATABASE_URL=postgres://postgres:bbb_graphql@localhost:5432/hasura_app #HASURA_GRAPHQL_METADATA_DATABASE_URL=postgres://postgres:bbb_graphql@localhost:5432/hasura_app #HASURA_GRAPHQL_NO_OF_RETRIES +HASURA_GRAPHQL_LOG_LEVEL=warn HASURA_GRAPHQL_ENABLE_CONSOLE=false HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_REFETCH_INTERVAL=250 HASURA_GRAPHQL_STREAMING_QUERIES_MULTIPLEXED_REFETCH_INTERVAL=100