String logMessage() { if (logMessage == null) { StringBuilder builder = new StringBuilder(64); builder .append(DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochMilli(time))) .append(" [") .append(Thread.currentThread().getName()) .append("] ") .append(level.name()) .append(' ') .append(logger) .append(" - "); if (arguments == null) builder.append(message); else builder.append(Strings.format(message, arguments)); builder.append(System.lineSeparator()); if (exception != null) builder.append(Exceptions.stackTrace(exception)); logMessage = builder.toString(); } return logMessage; }
@RequestMapping(value = "/", method = RequestMethod.GET) @ResponseBody public String tell() { return DateTimeFormatter.ISO_INSTANT.format(ZonedDateTime.now(clock)); }