Skip to content

Commit

Permalink
Suppress unnecessary gunicorn and grpc logs. (oppia#21290)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlip authored Nov 22, 2024
1 parent f1e10b7 commit 1f8ad71
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 7 additions & 2 deletions app_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ instance_class: F2
# #6534 on oppia/oppia).
version: default
# Timeout is set to 60 so that the gunicorn workers don't die while sending
# the Apache Beam jobs to Google Cloud Dataflow.
entrypoint: gunicorn --timeout 60 --bind :$PORT main:app
# the Apache Beam jobs to Google Cloud Dataflow. Log level is set to 'warning'
# because the info logs are very noisy.
entrypoint: gunicorn --timeout 60 --log-level warning --bind :$PORT main:app

inbound_services:
- warmup
Expand Down Expand Up @@ -181,3 +182,7 @@ env_variables:
DATASTORE_PROJECT_ID: "dev-project-id"
DATASTORE_USE_PROJECT_ID_AS_APP_ID: "true"
SECRETS: "{\"ANDROID_BUILD_SECRET\": \"android-build-secret\", \"VM_ID\": \"vm_default\", \"SHARED_SECRET_KEY\": \"1a2b3c4e\"}"
# These environment variables control GRPC logging verbosity. See
# https://stackoverflow.com/a/78803598.
GRPC_VERBOSITY: "ERROR"
GLOG_minloglevel: "2"
9 changes: 7 additions & 2 deletions app_dev_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ instance_class: F2
# #6534 on oppia/oppia).
version: default
# Timeout is set to 60 so that the gunicorn workers don't die while sending
# the Apache Beam jobs to Google Cloud Dataflow.
entrypoint: gunicorn --timeout 60 --bind :$PORT main:app
# the Apache Beam jobs to Google Cloud Dataflow. Log level is set to 'warning'
# because the info logs are very noisy.
entrypoint: gunicorn --timeout 60 --log-level warning --bind :$PORT main:app

inbound_services:
- warmup
Expand Down Expand Up @@ -188,3 +189,7 @@ env_variables:
DATASTORE_PROJECT_ID: "dev-project-id"
DATASTORE_USE_PROJECT_ID_AS_APP_ID: "true"
SECRETS: "{\"ANDROID_BUILD_SECRET\": \"android-build-secret\", \"VM_ID\": \"vm_default\", \"SHARED_SECRET_KEY\": \"1a2b3c4e\"}"
# These environment variables control GRPC logging verbosity. See
# https://stackoverflow.com/a/78803598.
GRPC_VERBOSITY: "ERROR"
GLOG_minloglevel: "2"
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
# Cloud Logging is disabled in emulator mode, since it is unnecessary and
# creates a lot of noise.
if not constants.EMULATOR_MODE:
# Instantiates a client and rtrieves a Cloud Logging handler based on the
# Instantiates a client and retrieves a Cloud Logging handler based on the
# environment you're running in and integrates the handler with the Python
# logging module.
client = google.cloud.logging.Client()
Expand Down

0 comments on commit 1f8ad71

Please sign in to comment.