Skip to content

Commit

Permalink
Activate debug logging (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostcar authored Sep 29, 2023
1 parent 3337688 commit ee03ae2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

The Service uses the following environment variables:

* `OPENSLIDES_DEVELOPMENT`: If set, the service uses the default secrets. The default is `false`.
* `ICC_PORT`: Port on which the service listen on. The default is `9007`.
* `MESSAGE_BUS_HOST`: Host of the redis server. The default is `localhost`.
* `MESSAGE_BUS_PORT`: Port of the redis server. The default is `6379`.
* `OPENSLIDES_DEVELOPMENT`: If set, the service uses the default secrets. The default is `false`.
* `DATABASE_PASSWORD_FILE`: Postgres Password. The default is `/run/secrets/postgres_password`.
* `DATABASE_USER`: Postgres Database. The default is `openslides`.
* `DATABASE_HOST`: Postgres Host. The default is `localhost`.
Expand Down
1 change: 1 addition & 0 deletions internal/notify/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func HandleReceive(mux *http.ServeMux, notify Receiver, auth icchttp.Authenticat
cid, next := notify.Receive(meetingID, uid)

icclog.Debug("HTTP Recieve from user %d, channel id: %s", uid, cid)
defer icclog.Debug("Closed HTTP Recieve from user %d, channel id: %s", uid, cid)

// Send channel id.
if _, err := fmt.Fprintf(w, `{"channel_id": "%s"}`+"\n", cid); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"net/http"
"os"
"strconv"

"github.com/OpenSlides/openslides-autoupdate-service/pkg/auth"
"github.com/OpenSlides/openslides-autoupdate-service/pkg/environment"
Expand Down Expand Up @@ -98,6 +99,10 @@ func buildDocu() error {
//
// Returns a the service as callable.
func initService(lookup environment.Environmenter) (func(context.Context) error, error) {
if devMode, _ := strconv.ParseBool(environment.EnvDevelopment.Value(lookup)); devMode {
icclog.SetDebugLogger(log.Default())
}

var backgroundTasks []func(context.Context, func(error))
listenAddr := ":" + envICCServicePort.Value(lookup)

Expand Down

0 comments on commit ee03ae2

Please sign in to comment.