-
Notifications
You must be signed in to change notification settings - Fork 25
Added loggers for debugging MAINT-38931 #553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ab2e2ad
80306bf
6be0731
dc5c622
88b968e
2fcb079
f11b9ad
542d9f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -566,7 +566,9 @@ public Mono<JobProfileUser> assignPermissions(StreamTask streamTask, ServiceAgre | |
|
|
||
| public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask task, | ||
| Map<User, Map<BusinessFunctionGroup, List<BaseProductGroup>>> usersPermissions) { | ||
|
|
||
| log.info("Assigning permissions batch for task: {}, usersPermissions: {}", | ||
| task, usersPermissions); | ||
| System.out.println("Assigning permissions batch for task: " + task + ", usersPermissions: " + usersPermissions); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use a system output? It's a super weird solution for logging
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we will revert everything after debugging is complete
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. system output is to make sure logs are printed without fail and to save some time
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. log.debug will also print when the appropriate level is set in configuration. |
||
| List<UserWithPermissions> request = usersPermissions.keySet().stream() | ||
| .map(user -> new UserWithPermissions( | ||
| user, task.getData().getServiceAgreement(), | ||
|
|
@@ -575,6 +577,7 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask | |
| .setFunctionGroupId(bfg.getId()) | ||
| .setFunctionGroupName(bfg.getName()) | ||
| .setServiceAgreementId(bfg.getServiceAgreementId()) | ||
| .setServiceAgreementExternalId(task.getData().getServiceAgreement().getExternalId()) | ||
| .setDataGroups(usersPermissions.get(user).get(bfg).stream() | ||
| .map(baseProductGroup -> new UserAssignedDataGroup() | ||
| .setDataGroupId(baseProductGroup.getInternalId()) | ||
|
|
@@ -585,6 +588,8 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask | |
| .collect(Collectors.toList()))) | ||
| .collect(Collectors.toList()))) | ||
| .collect(Collectors.toList()); | ||
| log.info("Assigned permissions request: {}", request); | ||
| System.out.println("Assigned permissions request: " + request); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. |
||
|
|
||
| return Mono.just(request) | ||
| .flatMap(userPermissionsRequest -> { | ||
|
|
@@ -611,6 +616,7 @@ public Mono<BatchProductGroupTask> assignPermissionsBatch(BatchProductGroupTask | |
| "Assigning permissions: %s", | ||
| userPermissionsList.stream().map(this::prettyPrintUserAssignedPermissions) | ||
| .collect(Collectors.joining(","))); | ||
| log.info("Assigned permissions request: {}", userPermissionsList); | ||
| return assignPermissionsIntegrationApi.batchUpdateUserPermissions(map(userPermissionsList)) | ||
| .map(r -> batchResponseUtils.checkBatchResponseItem(r, "Permissions Update", | ||
| r.getStatus().toString(), r.getResourceId(), r.getErrors())) | ||
|
|
@@ -1104,7 +1110,8 @@ public Flux<String> getDataGroupItemIdsByServiceAgreementId(String serviceAgreem | |
| */ | ||
| public Mono<List<BusinessFunctionGroup>> setupFunctionGroups(StreamTask streamTask, | ||
| ServiceAgreement serviceAgreement, List<BusinessFunctionGroup> businessFunctionGroups) { | ||
|
|
||
| log.info("Setup Function Groups for Service Agreement: {}", serviceAgreement.getExternalId()); | ||
| log.info("Setup Function Groups for businessFunctionGroups: {}", businessFunctionGroups); | ||
| streamTask.info(FUNCTION_GROUP, SETUP_FUNCTION_GROUP, "", serviceAgreement.getExternalId(), | ||
| serviceAgreement.getInternalId(), "Setting up %s Business Functions for Service Agreement: %s", | ||
| businessFunctionGroups.size(), serviceAgreement.getName()); | ||
|
|
@@ -1123,6 +1130,7 @@ public Mono<List<BusinessFunctionGroup>> setupFunctionGroups(StreamTask streamTa | |
| List<BusinessFunctionGroup> existingBusinessGroups = | ||
| getExistingBusinessGroups(businessFunctionGroups, functionGroups); | ||
| log.debug("existingBusinessGroups: {}", existingBusinessGroups); | ||
| log.info("existingBusinessGroups: {}", existingBusinessGroups); | ||
| return updateBatchBusinessFunctionGroup(streamTask, serviceAgreement, existingBusinessGroups) | ||
| .flatMap(updated -> { | ||
| bfg.addAll(existingBusinessGroups); | ||
|
|
@@ -1673,7 +1681,8 @@ private Mono<? extends JobRole> updateJobRole(StreamTask streamTask, ServiceAgre | |
|
|
||
| private Mono<List<com.backbase.accesscontrol.functiongroup.api.integration.v1.model.BatchResponseItemExtended>> updateBatchBusinessFunctionGroup( | ||
| StreamTask streamTask, ServiceAgreement serviceAgreement, List<BusinessFunctionGroup> existingBusinessGroups) { | ||
|
|
||
| log.info("Assigning {} Business Function Groups to Job Profile User: {}", existingBusinessGroups, | ||
| existingBusinessGroups); | ||
| log.info("Start Job Role updating: {}", | ||
| existingBusinessGroups.stream().map(BusinessFunctionGroup::getName).collect(Collectors.toList())); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be log all permissions on INFO level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will revert everything after debugging is complete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't develop for reverting. Change it to debug and set your log levels at runtime.