Source:
<code>public EventSenderResult send(AuditLogEvent event, AuditLogEventSubscriber subscriber) { EventSenderResult result = new EventSenderResult(); EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, event, isBodyHtml); String recipient = subscriber.getMethodAddress(); if (StringUtils.isEmpty(recipient)) { log.error("Email recipient is not known, please check user table ( email )" + " or event_subscriber ( method_address )," + " unable to send email for subscriber " + subscriber.getSubscriberId() + "," + <START> " message was " + message.getMessageSubject() + ":" + message.getMessageBody()); <END> result.setSent(false); return result; } log.info(String.format("Send email to [%s]%n subject:%n [%s]", recipient, message.getMessageSubject())); if (log.isDebugEnabled()) { log.debug(String.format("body:%n [%s]", message.getMessageBody())); } boolean shouldRetry = false; try { mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } for (int i = 0; i < 3 && shouldRetry; ++i) { shouldRetry = false; try { Thread.sleep(30000); mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } catch (InterruptedException e) { log.error("Failed to suspend thread for 30 seconds while trying to resend a mail message.", e); } } if (shouldRetry) { result.setSent(false); } else { result.setSent(true); } return result; }</code><technical_language>String.format</technical_language>

Target:
public EventSenderResult send(AuditLogEvent event, AuditLogEventSubscriber subscriber) { EventSenderResult result = new EventSenderResult(); EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, event, isBodyHtml); String recipient = subscriber.getMethodAddress(); if (StringUtils.isEmpty(recipient)) { log.error(String.format("Email recipient is not known, please check user table ( email )" + " or event_subscriber ( method_address )," + " unable to send email for subscriber %s ," + " message was %s:", subscriber.getSubscriberId(), message.getMessageSubject(), message.getMessageBody())); result.setSent(false); return result; } log.info(String.format("Send email to [%s]%n subject:%n [%s]", recipient, message.getMessageSubject())); if (log.isDebugEnabled()) { log.debug(String.format("body:%n [%s]", message.getMessageBody())); } boolean shouldRetry = false; try { mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } for (int i = 0; i < RETRY_COUNT && shouldRetry; ++i) { shouldRetry = false; try { Thread.sleep(30000); mailSender.send(recipient, message.getMessageSubject(), message.getMessageBody()); } catch (MessagingException ex) { result.setReason(ex.getMessage()); shouldRetry = true; } catch (InterruptedException e) { log.error("Failed to suspend thread for 30 seconds while trying to resend a mail message.", e); } } if (shouldRetry) { result.setSent(false); } else { result.setSent(true); } return result; }