@Override
    protected void doApply(ApiResponse response, IPolicyContext context, LogHeadersConfigBean config,
            IPolicyChain<ApiResponse> chain) {
        IApimanLogger logger = context.getLogger(getClass());
        if (config.getDirection() != LogHeadersDirectionType.request) {
            String endpoint = context.getAttribute(ENDPOINT_ATTRIBUTE, ""); //$NON-NLS-1$
            if (config.isLogStatusCode()) {
                logger.info(String.format("Status code %d for %s", response.getCode(), endpoint));
            }
            if (config.isLogHeaders()) {
                logHeaders(logger, response.getHeaders(), HttpDirection.RESPONSE, endpoint);
            }
        }
        chain.doApply(response);
    }
@see io.apiman.gateway.engine.policies.AbstractMappedPolicy#doApply(io.apiman.gateway.engine.beans.ApiResponse, io.apiman.gateway.engine.policy.IPolicyContext, java.lang.Object, io.apiman.gateway.engine.policy.IPolicyChain)
plugins/log-policy/src/main/java/io/apiman/plugins/log_policy/LogHeadersPolicy.java