Skip to content

Commit

Permalink
add DEBUG_FHIR_REQUESTS config should we need to debug the requests
Browse files Browse the repository at this point in the history
being routed to the FHIR server, again.
  • Loading branch information
pbugni committed Oct 10, 2023
1 parent ece9d78 commit e6e046f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions confidential_backend/api/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ def route_fhir(relative_path, session_id):
if header_name in request.headers:
upstream_headers[header_name] = request.headers[header_name]

current_app.logger.debug(f'request headers (incoming to /fhir-router): {request.headers}')
current_app.logger.debug(f'upstream headers (outgoing to {upstream_fhir_url}): {upstream_headers} ;;; params: {request.args} ;;; json: {request.json}')
if current_app.config['DEBUG_FHIR_REQUESTS']:
current_app.logger.debug(
f'request headers (incoming to /fhir-router): {request.headers}')
current_app.logger.debug(
f'upstream headers (outgoing to {upstream_fhir_url}): '
f'{upstream_headers} ;;; params: {request.args} ;;; json: {request.json}')

upstream_response = requests.request(
url=upstream_fhir_url,
Expand Down
1 change: 1 addition & 0 deletions confidential_backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import redis

AUTH_TOKEN_LOG_FILTER = os.getenv("AUTH_TOKEN_LOG_FILTER").split(",") if "AUTH_TOKEN_LOG_FILTER" in os.environ else None
DEBUG_FHIR_REQUESTS = os.getenv("DEBUG_FHIR_REQUESTS", "false").lower() == "true"
DEBUG_OUTPUT_DIR = os.getenv("DEBUG_OUTPUT_DIR", '/tmp')
SERVER_NAME = os.getenv("SERVER_NAME")
SECRET_KEY = os.getenv("SECRET_KEY")
Expand Down

0 comments on commit e6e046f

Please sign in to comment.