@@ -110,7 +110,7 @@ public CRMController(@Value("${crm.collab-person-prefix}") String collabPersonPr
110110 crmConfigEntry -> crmConfigEntry .code (),
111111 crmConfigEntry -> crmConfigEntry
112112 ));
113- LOG .info (String .format ("Parsed %s entries from %s" , this .crmConfig .size (), crmConfigResource .getDescription ()));
113+ LOG .debug (String .format ("Parsed %s entries from %s" , this .crmConfig .size (), crmConfigResource .getDescription ()));
114114 this .invitationRepository = invitationRepository ;
115115 }
116116
@@ -144,14 +144,14 @@ public ResponseEntity<String> delete(@RequestBody CRMContact crmContact) {
144144 List <Invitation > invitations = invitationRepository .findByCrmContactIdAndCrmOrganisationId (
145145 crmContact .getContactId (), crmContact .getOrganisation ().getOrganisationId ());
146146 invitations .forEach (invitation -> {
147- LOG .info ("Deleting CRM invitation: " + invitation .getEmail ());
147+ LOG .debug ("Deleting CRM invitation: " + invitation .getEmail ());
148148 this .invitationRepository .delete (invitation );
149149 });
150150
151151 Optional <User > userOptional = userRepository .findByCrmContactIdAndCrmOrganisationId (
152152 crmContact .getContactId (), crmContact .getOrganisation ().getOrganisationId ());
153153 userOptional .ifPresent (user -> {
154- LOG .info ("Deleting CRM user: " + user .getEmail ());
154+ LOG .debug ("Deleting CRM user: " + user .getEmail ());
155155 this .provisioningService .deleteUserRequest (user );
156156 this .userRepository .delete (user );
157157 });
@@ -178,6 +178,10 @@ private boolean provisionUser(CRMContact crmContact) {
178178 this .provisioningService .updateGroupRequest (userRole , OperationType .add );
179179 });
180180 userRepository .save (user );
181+
182+ LOG .debug (String .format ("Provisioned user %s with roles %s" ,
183+ user .getEmail (), roles .stream ().map (Role ::getName ).collect (Collectors .joining ("," ))));
184+
181185 return optionalUser .isEmpty ();
182186 }
183187
@@ -193,6 +197,10 @@ private User createUser(CRMContact crmContact, String sub) {
193197 StringUtils .hasText (middleName ) ? String .format ("%s %s" , middleName , surName ) : surName ,
194198 crmContact .getEmail ());
195199 User user = userRepository .save (unsavedUser );
200+
201+ LOG .debug (String .format ("Created new user %s with sub %s" ,
202+ user .getEmail (), sub ));
203+
196204 this .provisioningService .newUserRequest (user );
197205 return user ;
198206 }
@@ -244,6 +252,10 @@ private boolean sendInvitation(CRMContact crmContact) {
244252 Invitation invitation = createInvitation (crmContact , invitationRoles );
245253
246254 Optional <String > idpName = identityProviderName (manage , invitation );
255+
256+ LOG .debug (String .format ("Sending invitation to user %s for roles %s" ,
257+ invitation .getEmail (), roles .stream ().map (Role ::getName ).collect (Collectors .joining ("," ))));
258+
247259 mailBox .sendInviteMail (this .provisionable , invitation , groupedProviders , Language .en , idpName );
248260 }
249261 return optionalUser .isEmpty ();
0 commit comments