Open
Conversation
drudoi
requested changes
Jun 13, 2025
| $uid = $this->currentUser->id(); | ||
| $user = $this->userStorage->load($uid); | ||
| $context['user'] = $user->getDisplayName(); | ||
| $context['email'] = $user->getEmail(); |
Collaborator
There was a problem hiding this comment.
Log PII data is unsafe. `$context['uid'] is already in the context and it should be enough for technical info.
| $context['user'] = $user->getDisplayName(); | ||
| $context['email'] = $user->getEmail(); | ||
| } | ||
| $this->loggerFactory->get('quanthub_sdmx_proxy')->info('forwardDownload', $context); |
Collaborator
There was a problem hiding this comment.
- I propose define human-readable messages.
- May be
->debug()level is better.
| $context = []; | ||
| $context['uri'] = $uri; | ||
| if ($body = $request->getContent()) { | ||
| $context['body'] = $body; |
Collaborator
There was a problem hiding this comment.
"body" context isn't supported by Drupal loggers, let use "%body" variable.
| */ | ||
| private $foundationFactory; | ||
|
|
||
| private const DOWNLOAD_SUBMIT_PATH = '/submit'; |
Collaborator
There was a problem hiding this comment.
The constant is used once, I propose have string in place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Universal approach to just log submit info about downloads. Should work with anonymous and real user
{ "message": "forwardDownload", "context": { "uri": "/workspaces/default:SwissRe/engine/data/async/submit", "body": "{\"_type\":\"SdmxTableDataQueryPlusV2\",\"includeHistory\":\"false\",\"dimensionAtObservation\":\"TIME_PERIOD\",\"messageVersion\":\"2.0.0\",\"outputFormat\":\"EXCEL\",\"viewMode\":\"TIMESERIES_PER_ROW\",\"agencyID\":\"SWRE\",\"resourceID\":\"STANDARD_INSURANCE_DATA\",\"version\":\"2.0.1\",\"columns\":[{\"componentId\":\"FREQUENCY\",\"value\":\"name\",\"header\":\"name\"},{\"componentId\":\"COUNTRY\",\"value\":\"name\",\"header\":\"name\"},{\"componentId\":\"SERIES\",\"value\":\"name\",\"header\":\"name\"},{\"componentId\":\"SOURCE\",\"value\":\"name\",\"header\":\"name\"},{\"componentId\":\"BUSINESS_LINE\",\"value\":\"name\",\"header\":\"name\"}],\"filters\":[{\"componentCode\":\"TIME_PERIOD\",\"operator\":\"ge\",\"value\":\"631152000000\"},{\"componentCode\":\"TIME_PERIOD\",\"operator\":\"le\",\"value\":\"2082844799999\"}],\"headerConfig\":{\"languages\":[\"en\"]},\"limit\":null,\"rows\":[{\"componentId\":\"OBS_VALUE\"}]}", "user": "Illya Havsiyevych", "email": "Illya_Havsiyevych@epam.com" }, "level": 200, "level_name": "INFO", "channel": "quanthub_sdmx_proxy", "datetime": "2025-06-13T06:45:57.620595+02:00", "extra": { "referer": "https://quanthub-portals-swiss-re.imf-eid.projects.epam.com/explorer", "ip": "10.0.0.205", "request_uri": "https://quanthub-portals-swiss-re.imf-eid.projects.epam.com/sdmx-download/workspaces/default:SwissRe/engine/data/async/submit", "uid": "77", "user": "Illya_Havsiyevych@epam.com" } }