Skip to content
Open
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
8 changes: 8 additions & 0 deletions releases/unreleased/uwsgi-request-logs-removed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: UWSGI request logs removed
category: fixed
author: Jose Javier Merchante <[email protected]>
issue: null
notes: >
Remove request logs generated by uWSGI as they are duplicated
by Django structlog's loggin middleware.
10 changes: 9 additions & 1 deletion src/grimoirelab/core/runner/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def server(ctx: Context, devel: bool, maintenance_interval: int):
env["UWSGI_LAZY_APPS"] = "true"
env["UWSGI_SINGLE_INTERPRETER"] = "true"

# Request logs from UWSGI are removed
# We will use Django structlog instead
env["UWSGI_REQ_LOGGER"] = "file:/dev/null"

# Run maintenance tasks in the background
_maintenance_process(maintenance_interval)

Expand All @@ -139,7 +143,11 @@ def periodic_maintain_tasks(interval):
logger.info("Maintenance task interrupted. Exiting...")
return

time.sleep(interval)
try:
time.sleep(interval)
except KeyboardInterrupt:
logger.info("Maintenance task stopped.")
return


def _maintenance_process(maintenance_interval):
Expand Down