Here you can find the source of logError(String message, Throwable ex, Logger logger, String userId)
public static void logError(String message, Throwable ex, Logger logger, String userId)
//package com.java2s; //License from project: Apache License import org.slf4j.Logger; public class Main { /**//from w w w. j a va 2s . co m * This is used for logging exceptions with additional information in the log message. This method is called for non * identifiable exceptions (which will not be surfaced to the user). */ public static void logError(String message, Throwable ex, Logger logger, String userId) { StringBuilder sb = new StringBuilder(); sb.append(getLogElement("LdapId", userId)).append(getLogElement("Exception", message)) .append(getLogElement("Cause", ex.getMessage())); logger.error(sb.toString(), ex); } private static String getLogElement(String label, Object value) { if (value != null) { return "[" + label + ": " + value + "] "; } return ""; } }