@@ -294,14 +294,28 @@ protected function query(string $method, array $request): array {
294294 ];
295295 }
296296
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+
297311 try {
298- $ msg = sprintf ('Method %s called with (%s) ' , $ method , implode ( ' , ' , $ request ) );
312+ $ msg = sprintf ('Method %s called with (%s) ' , $ method , $ auditLoggingMethodParameter );
299313 $ this ->auditLogger ->info ('DataLookup ' , $ msg );
300314 $ response = (array ) $ this ->client ->$ method ($ request );
301315 $ response ['status ' ] = TRUE ;
302316 }
303317 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 );
305319 $ this ->auditLogger ->error ('DataLookup ' , $ msg );
306320 $ response = [
307321 'status ' => FALSE ,
0 commit comments