Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate debug logging #120

Merged
merged 3 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading