private String getMessage(final LogRecord record) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append('(').append("tid=").append(record.getThreadID()) .append(" msgId=").append(record.getSequenceNumber()).append(") "); if (record.getMessage() != null) { stringBuilder.append(getFormatter().formatMessage(record)); } return stringBuilder.toString(); }
.append(record.getLevel().getLocalizedName()) .append(": ") .append(formatMessage(record)) .append(LINE_SEPARATOR);
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
/** * Localize and format the message string from a log record. * * @param record PARAM * @return Returns */ public String formatMessage( LogRecord record ) { return super.formatMessage( record ); }
/** * Localize and format the message string from a log record. * * @param record PARAM * @return Returns */ public String formatMessage( LogRecord record ) { return super.formatMessage( record ); }
/** * Localize and format the message string from a log record. * * @param record PARAM * @return Returns */ public String formatMessage( LogRecord record ) { return super.formatMessage( record ); }
/** * Localize and format the message string from a log record. * * @param record PARAM * @return Returns */ public String formatMessage( LogRecord record ) { return super.formatMessage( record ); }
public static LogRecord formatMessage(Formatter formatter, LogRecord record) { record.setMessage(formatter.formatMessage(record)); record.setSourceClassName(record.getSourceClassName()); return record; }
@Override public synchronized void publish(LogRecord record) { super.publish(record); String message = f.formatMessage(record); Throwable x = record.getThrown(); messages.add(message == null && x != null ? x.toString() : message); } };
@Override public void publish(LogRecord record) { repository.getLogger(record.getLoggerName() == null ? "unknown" : record.getLoggerName()) .log(Log.convertJuliLevel(record.getLevel()), formatter.formatMessage(record), record.getThrown()); }
private String getMessage(LogRecord record) { final StringBuilder b = new StringBuilder(); b .append('(') .append("tid=" + record.getThreadID()) .append(" msgId=" + record.getSequenceNumber()) .append(") "); if (record.getMessage() != null) { b.append(getFormatter().formatMessage(record)); } return b.toString(); }
private String getMessage(LogRecord record) { final StringBuilder b = new StringBuilder(); b .append('(') .append("tid=" + record.getThreadID()) .append(" msgId=" + record.getSequenceNumber()) .append(") "); if (record.getMessage() != null) { b.append(getFormatter().formatMessage(record)); } return b.toString(); }
@Override public synchronized String formatMessage(LogRecord record) { Object[] extraParameters = record.getParameters(); String result = null; if (isThereLogDataParameter(extraParameters)) { Object[] extraParametersWithoutLogData = Arrays.copyOfRange(extraParameters, 1, extraParameters.length); record.setParameters(extraParametersWithoutLogData); result = super.formatMessage(record); record.setParameters(extraParameters); } else { result = super.formatMessage(record); } return result; } }
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
/** * Formats message for the log record. This method removes any fully * qualified throwable class names from the message. * * @param record the log record. * @return the formatted message string. */ @Override public String formatMessage(final LogRecord record) { String msg = super.formatMessage(record); msg = replaceClassName(msg, record.getThrown()); msg = replaceClassName(msg, record.getParameters()); return msg; }
@Override public String toString() { Logger logger = Logger.getLogger(sourceClassName, bundleName); LogRecord record = new LogRecord(Level.INFO, messageId); if (cause == null) { record.setParameters(messageParams); } else { Object[] params = new String[1]; params[0] = cause.toString(); record.setParameters(params); } record.setResourceBundle(logger.getResourceBundle()); record.setSourceClassName(sourceClassName); Formatter formatter = new SimpleFormatter(); return context + " - " + formatter.formatMessage(record); } }
public void publish(LogRecord record) { if(! isLoggable(record)) return; String formattedMessage; try { formattedMessage = getFormatter().formatMessage(record); } catch(Exception e) { reportError(null, e, ErrorManager.FORMAT_FAILURE); return; } log4jLogger.callAppenders ( new XLoggingEvent(log4jLogger, record, formattedMessage) ); }