Skip to content

Conversation

@alhendrickson
Copy link
Collaborator

@alhendrickson alhendrickson commented Oct 28, 2025

This fixes the access log format to add a timestamp.

This env variable in start_service_production.sh doesnt work when using uvicorn worker. This line doesnt do anything --access-logformat="$SERVER_ACCESS_LOG_FORMAT" \

This fix hardcodes the config in and adds a note. For a later PR, we could look to support env vars for the access log as it used to exist, and remove the line from the shell. For now I'd want to get this in as is, as it at least fixes it and documents it a bit.

Behavior Before

cogstack-medcat-service-production  | Starting MedCAT Service
...
cogstack-medcat-service-production  | 172.20.0.1:33514 - "GET /api/health/live HTTP/1.1" 200
cogstack-medcat-service-production  | 172.20.0.1:40408 - "POST /api/process HTTP/1.1" 200

Behavior After

cogstack-medcat-service-production  | Starting MedCAT Service
cogstack-medcat-service-production  | Starting up the service using gunicorn server ...
cogstack-medcat-service-production  | [2025-10-28 16:37:55 +0000] [1] [INFO] Starting gunicorn 23.0.0
..
cogstack-medcat-service-production  | 2025-10-28 16:38:09,939 [ACCESS] - 172.20.0.1:60072 - "GET /api/health/live HTTP/1.1" 200 OK
...
cogstack-medcat-service-production  | 2025-10-28 16:38:23,278 [INFO] MedCatProcessor: MedCAT processor is ready
cogstack-medcat-service-production  | 2025-10-28 16:38:23,390 [ACCESS] - 172.20.0.1:60088 - "POST /api/process HTTP/1.1" 200 OK

Copy link
Collaborator

@mart-r mart-r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright to me.

@alhendrickson alhendrickson merged commit 331fa61 into main Oct 28, 2025
11 checks passed
@alhendrickson alhendrickson deleted the fix/medcat-service/access-log branch October 28, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants