try {
chain.doFilter(request, response);
} finally {
try {
if (HystrixRequestContext.isCurrentThreadInitialized()) {
HystrixRequestLog log = HystrixRequestLog.getCurrentRequest();
if (log != null) {
((HttpServletResponse) response).addHeader("X-HystrixLog", log.getExecutedCommandsAsString());
}
}
} catch (Exception e) {
logger.warn("Unable to append HystrixRequestLog", e);
}