@@ -294,14 +294,28 @@ protected function query(string $method, array $request): array {
294
294
];
295
295
}
296
296
297
+ // Prepare request data for logging.
298
+ if (in_array ($ method , ['callCPRBasicInformationService ' , 'PersonLookup ' ])) {
299
+ $ auditLoggingMethodParameter = 'PNR, ' . $ request ['PNR ' ] ?? '' ;
300
+ }
301
+ elseif ($ method === 'getLegalUnit ' ) {
302
+ $ auditLoggingMethodParameter = 'LegalUnitIdentifier, ' . $ request ['GetLegalUnitRequest ' ]['LegalUnitIdentifier ' ] ?? '' ;
303
+ }
304
+ elseif ($ method === 'getProductionUnit ' ) {
305
+ $ auditLoggingMethodParameter = 'ProductionUnitIdentifier, ' . $ request ['GetProductionUnitRequest ' ]['ProductionUnitIdentifier ' ] ?? '' ;
306
+ }
307
+ else {
308
+ $ auditLoggingMethodParameter = sprintf ('Unhandled method: %s ' , $ method );
309
+ }
310
+
297
311
try {
298
- $ msg = sprintf ('Method %s called with (%s) ' , $ method , implode ( ' , ' , $ request ) );
312
+ $ msg = sprintf ('Method %s called with (%s) ' , $ method , $ auditLoggingMethodParameter );
299
313
$ this ->auditLogger ->info ('DataLookup ' , $ msg );
300
314
$ response = (array ) $ this ->client ->$ method ($ request );
301
315
$ response ['status ' ] = TRUE ;
302
316
}
303
317
catch (\SoapFault $ e ) {
304
- $ msg = sprintf ('Method %s called with (%s): %s ' , $ method , implode ( ' , ' , $ request ) , $ e ->faultstring );
318
+ $ msg = sprintf ('Method %s called with (%s): %s ' , $ method , $ auditLoggingMethodParameter , $ e ->faultstring );
305
319
$ this ->auditLogger ->error ('DataLookup ' , $ msg );
306
320
$ response = [
307
321
'status ' => FALSE ,
0 commit comments