Skip to content

bb2-5332 add logging - #1786

Open
BenColeCode wants to merge 7 commits into
masterfrom
bencolecode/bb2-5332-add-logging
Open

BenColeCode wants to merge 7 commits into
masterfrom
bencolecode/bb2-5332-add-logging

Conversation

@BenColeCode

Copy link
Copy Markdown
Contributor

JIRA Ticket:
BB2-5332

What Does This PR Do?

Adds status code logging to relationships endpoint

What Should Reviewers Watch For?

Does this log the status of requests?

If you're reviewing this PR, please check for these things in particular:

Validation

make a request to the endpoint and check the logs

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies
  • Modifies any security controls
  • Adds new transmission or storage of data
  • Any other changes that could possibly affect security?
  • Yes, one or more of the above security implications apply. This PR must not be merged without the ISSO or team
    security engineer's approval.

Any Migrations?

  • Yes, there are migrations
    • The migrations should be run PRIOR to the code being deployed
    • The migrations should be run AFTER the code is deployed
    • There is a more complicated migration plan (downtime,
      etc)
  • No migrations

Comment thread apps/mymedicare_cb/authorization.py Outdated
verify=self.verify_ssl_internal,
)

logger.info({'Status of Request':response.status_code})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's update this so it aligns with how other logs output 'response_code', and also some indication that it's the status_code for the relationships retrieval call

@JamesDemeryNava JamesDemeryNava left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Log appears as expected, let's add some more detail and conform with logging patterns.

@BenColeCode

Copy link
Copy Markdown
Contributor Author

Log appears as expected, let's add some more detail and conform with logging patterns.

Ok! I had taken that from apps/fhir/bluebutton/utils. I will look for other instances of status logging.

@BenColeCode

Copy link
Copy Markdown
Contributor Author

Ok, I have added to the dict obj to match other logging in the same file, while still printing the status code roughly the same as how we do it in fhir.

verify=self.verify_ssl_internal,
)

log_dict = {'type': 'Authentication:relationships_retrieval', 'status': response.status_code}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This never actually gets logged. Need to add logger.info(log_dict), and change the key to response_code to match other logs.

@JamesDemeryNava JamesDemeryNava left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Log is not output

This branch has not been deployed

No deployments
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.

2 participants