Source:
<code>public void afterPropertiesSet() { ApiPolicyResolver apiPolicyResolver = new ApiPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); PolicyChainProvider apiPolicyChainProvider = new ApiPolicyChainProvider(StreamType.ON_REQUEST, apiPolicyResolver); SecurityPolicyResolver securityPolicyResolver = new SecurityPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyResolver); PolicyChainProvider securityPolicyChainProvider = new SecurityPolicyChainProvider(securityPolicyResolver); PlanPolicyResolver planPolicyResolver = new PlanPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyResolver); PolicyChainProvider planPolicyChainProvider = new PlanPolicyChainProvider(StreamType.ON_REQUEST, planPolicyResolver); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); if (api.getProxy().getCors() != null && api.getProxy().getCors().isEnabled()) { providers.add(new ProcessorSupplier<>(() -> new StreamableProcessorDecorator<>(new CorsPreflightRequestProcessor(api.getProxy().getCors())))); } providers.add(securityPolicyChainProvider); if (api.getProxy().getLogging() != null && api.getProxy().getLogging().getMode() != LoggingMode.NONE) { providers.add(new ProcessorSupplier<>(new Supplier<StreamableProcessor<ExecutionContext, Buffer>>() { @Override public StreamableProcessor<ExecutionContext, Buffer> get() { ApiLoggableRequestProcessor processor = new ApiLoggableRequestProcessor(api.getProxy().getLogging(), <START> new LogConfiguration(logSSLInfo, logSSLCertificates, (maxSizeLogMessage <= - 1) ? -1 : maxSizeLogMessage * (1024 * 1024))); <END> return new StreamableProcessorDecorator<>(processor); } } )); } providers.add(planPolicyChainProvider); providers.add(apiPolicyChainProvider); }</code><technical_language>I prefer define a LogConfiguration.Builder more easier maintain manage adding new configuration properties</technical_language>

Target:
public void afterPropertiesSet() { ApiPolicyResolver apiPolicyResolver = new ApiPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); PolicyChainProvider apiPolicyChainProvider = new ApiPolicyChainProvider(StreamType.ON_REQUEST, apiPolicyResolver); SecurityPolicyResolver securityPolicyResolver = new SecurityPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyResolver); PolicyChainProvider securityPolicyChainProvider = new SecurityPolicyChainProvider(securityPolicyResolver); PlanPolicyResolver planPolicyResolver = new PlanPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyResolver); PolicyChainProvider planPolicyChainProvider = new PlanPolicyChainProvider(StreamType.ON_REQUEST, planPolicyResolver); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); if (api.getProxy().getCors() != null && api.getProxy().getCors().isEnabled()) { providers.add(new ProcessorSupplier<>(() -> new StreamableProcessorDecorator<>(new CorsPreflightRequestProcessor(api.getProxy().getCors())))); } providers.add(securityPolicyChainProvider); if (api.getProxy().getLogging() != null && api.getProxy().getLogging().getMode() != LoggingMode.NONE) { providers.add(new ProcessorSupplier<>(new Supplier<StreamableProcessor<ExecutionContext, Buffer>>() { @Override public StreamableProcessor<ExecutionContext, Buffer> get() { ApiLoggableRequestProcessor processor = new ApiLoggableRequestProcessor(api.getProxy().getLogging(), (new LogConfiguration.Builder()) .maxSizeLogMessage(maxSizeLogMessage * (1024 * 1024)) .withSsl(logSSLInfo, logSSLCertificates).build()); return new StreamableProcessorDecorator<>(processor); } } )); } providers.add(planPolicyChainProvider); providers.add(apiPolicyChainProvider); }