diff --git a/src/github.com/matrix-org/dendrite/appservice/appservice.go b/src/github.com/matrix-org/dendrite/appservice/appservice.go index 7d6bbec6..421e03d7 100644 --- a/src/github.com/matrix-org/dendrite/appservice/appservice.go +++ b/src/github.com/matrix-org/dendrite/appservice/appservice.go @@ -68,7 +68,7 @@ func SetupAppServiceAPIComponent( // Create bot account for this AS if it doesn't already exist if err = generateAppServiceAccount(accountsDB, deviceDB, appservice); err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, + "appservice_id": appservice.ID, }).WithError(err).Panicf("failed to generate bot account for appservice") } } @@ -141,7 +141,7 @@ func setupWorkers( // Create a worker that handles transmitting events to a single homeserver for _, workerState := range workerStates { log.WithFields(log.Fields{ - "appservice": workerState.AppService.ID, + "appservice_id": workerState.AppService.ID, }).Info("starting application service") // Don't create a worker if this AS doesn't want to receive events diff --git a/src/github.com/matrix-org/dendrite/appservice/query/query.go b/src/github.com/matrix-org/dendrite/appservice/query/query.go index ef4e04c9..681b7730 100644 --- a/src/github.com/matrix-org/dendrite/appservice/query/query.go +++ b/src/github.com/matrix-org/dendrite/appservice/query/query.go @@ -90,8 +90,8 @@ func (a *AppServiceQueryAPI) RoomAliasExists( err = resp.Body.Close() if err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, - "status_code": resp.StatusCode, + "appservice_id": appservice.ID, + "status_code": resp.StatusCode, }).WithError(err).Error("Unable to close application service response body") } }() @@ -110,8 +110,8 @@ func (a *AppServiceQueryAPI) RoomAliasExists( default: // Application service reported an error. Warn log.WithFields(log.Fields{ - "appservice": appservice.ID, - "status_code": resp.StatusCode, + "appservice_id": appservice.ID, + "status_code": resp.StatusCode, }).Warn("Application service responded with non-OK status code") } } @@ -159,7 +159,7 @@ func (a *AppServiceQueryAPI) UserIDExists( } if err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, + "appservice_id": appservice.ID, }).WithError(err).Error("issue querying user ID on application service") return err } @@ -172,8 +172,8 @@ func (a *AppServiceQueryAPI) UserIDExists( // Log if return code is not OK log.WithFields(log.Fields{ - "appservice": appservice.ID, - "status_code": resp.StatusCode, + "appservice_id": appservice.ID, + "status_code": resp.StatusCode, }).Warn("application service responded with non-OK status code") } } @@ -305,7 +305,7 @@ func contactApplicationService( req, err := http.NewRequest(http.MethodGet, requestURL, bytes.NewReader(request.Content)) if err != nil { log.WithFields(log.Fields{ - "appservice": as.ID, + "appservice_id": as.ID, }).WithError(err).Error("problem building proxy request to application service") return } @@ -318,15 +318,15 @@ func contactApplicationService( } if err != nil { log.WithFields(log.Fields{ - "appservice": as.ID, + "appservice_id": as.ID, }).WithError(err).Warn("unable to proxy request to application service") return } if resp.StatusCode != http.StatusOK { log.WithFields(log.Fields{ - "appservice": as.ID, - "status_code": resp.StatusCode, + "appservice_id": as.ID, + "status_code": resp.StatusCode, }).Warn("non-OK response from application server while proxying request") return } @@ -336,7 +336,7 @@ func contactApplicationService( body, err := ioutil.ReadAll(resp.Body) if err != nil { log.WithFields(log.Fields{ - "appservice": as.ID, + "appservice_id": as.ID, }).WithError(err).Warn("unable to read response from application server while proxying request") return } @@ -346,7 +346,7 @@ func contactApplicationService( err = json.Unmarshal(body, &querySlice) if err != nil { log.WithFields(log.Fields{ - "appservice": as.ID, + "appservice_id": as.ID, }).WithError(err).Warn("unable to unmarshal response from application server while proxying request") return } diff --git a/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go b/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go index 285bbf48..e53b4f22 100644 --- a/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go +++ b/src/github.com/matrix-org/dendrite/appservice/storage/appservice_events_table.go @@ -119,7 +119,7 @@ func (s *eventsStatements) selectEventsByApplicationServiceID( err = eventRows.Close() if err != nil { log.WithFields(log.Fields{ - "appservice": applicationServiceID, + "appservice_id": applicationServiceID, }).WithError(err).Fatalf("appservice unable to select new events to send") } }() diff --git a/src/github.com/matrix-org/dendrite/appservice/workers/third_party.go b/src/github.com/matrix-org/dendrite/appservice/workers/third_party.go index 27b96a5a..c07fc4a6 100644 --- a/src/github.com/matrix-org/dendrite/appservice/workers/third_party.go +++ b/src/github.com/matrix-org/dendrite/appservice/workers/third_party.go @@ -66,7 +66,7 @@ func ThirdPartyWorker( ) if err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, + "appservice_id": appservice.ID, "backoff_exponent": backoffCount, }).WithError(err).Warn("error contacting appservice thirdparty endpoints") @@ -82,8 +82,8 @@ func ThirdPartyWorker( err = storeProtocolDefinition(ctx, db, protocolID, protocolDefinition) if err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, - "definition": protocolDefinition, + "appservice_id": appservice.ID, + "definition": protocolDefinition, }).WithError(err).Fatalf("unable to store appservice protocol definition in db") } } diff --git a/src/github.com/matrix-org/dendrite/appservice/workers/transaction_scheduler.go b/src/github.com/matrix-org/dendrite/appservice/workers/transaction_scheduler.go index 3933f4ef..90c84944 100644 --- a/src/github.com/matrix-org/dendrite/appservice/workers/transaction_scheduler.go +++ b/src/github.com/matrix-org/dendrite/appservice/workers/transaction_scheduler.go @@ -53,7 +53,7 @@ func TransactionWorker(db *storage.Database, ws types.ApplicationServiceWorkerSt eventCount, err := db.CountEventsWithAppServiceID(ctx, ws.AppService.ID) if err != nil { log.WithFields(log.Fields{ - "appservice": ws.AppService.ID, + "appservice_id": ws.AppService.ID, }).WithError(err).Fatal("appservice worker unable to read queued events from DB") return } @@ -70,7 +70,7 @@ func TransactionWorker(db *storage.Database, ws types.ApplicationServiceWorkerSt transactionJSON, txnID, maxEventID, eventsRemaining, err := createTransaction(ctx, db, ws.AppService.ID) if err != nil { log.WithFields(log.Fields{ - "appservice": ws.AppService.ID, + "appservice_id": ws.AppService.ID, }).WithError(err).Fatal("appservice worker unable to create transaction") return @@ -81,7 +81,7 @@ func TransactionWorker(db *storage.Database, ws types.ApplicationServiceWorkerSt err = send(client, ws.AppService, txnID, transactionJSON) if err != nil { log.WithFields(log.Fields{ - "appservice": ws.AppService.ID, + "appservice_id": ws.AppService.ID, "backoff_exponent": ws.Backoff, }).WithError(err).Warnf("unable to send transactions successfully, backing off") @@ -103,7 +103,7 @@ func TransactionWorker(db *storage.Database, ws types.ApplicationServiceWorkerSt err = db.RemoveEventsBeforeAndIncludingID(ctx, ws.AppService.ID, maxEventID) if err != nil { log.WithFields(log.Fields{ - "appservice": ws.AppService.ID, + "appservice_id": ws.AppService.ID, }).WithError(err).Fatal("unable to remove appservice events from the database") return } @@ -126,7 +126,7 @@ func createTransaction( txnID, maxID, events, eventsRemaining, err := db.GetEventsWithAppServiceID(ctx, appserviceID, transactionBatchSize) if err != nil { log.WithFields(log.Fields{ - "appservice": appserviceID, + "appservice_id": appserviceID, }).WithError(err).Fatalf("appservice worker unable to read queued events from DB") return @@ -177,7 +177,7 @@ func send( err := resp.Body.Close() if err != nil { log.WithFields(log.Fields{ - "appservice": appservice.ID, + "appservice_id": appservice.ID, }).WithError(err).Error("unable to close response body from application service") } }()