/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. */ private static void forcedLog(final Logger logger, final Level level, final String msg) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, null)); }
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. */ private static void forcedLog(final Logger logger, final Level level, final String msg) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, null)); }
/** * Log an exiting message at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. */ public static void exiting(final Logger logger, final String sourceClass, final String sourceMethod) { if (logger.isDebugEnabled()) { logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, sourceClass + "." + sourceMethod + " RETURN", null)); } }
/** * Log an entering message at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. */ public static void entering(final Logger logger, final String sourceClass, final String sourceMethod) { if (logger.isDebugEnabled()) { logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, sourceClass + "." + sourceMethod + " ENTRY", null)); } }
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. * @param t throwable. */ private static void forcedLog(final Logger logger, final Level level, final String msg, final Throwable t) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, t)); } /**
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. * @param t throwable. */ private static void forcedLog(final Logger logger, final Level level, final String msg, final Throwable t) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, t)); } /**
/** * Log an entering message with a parameter at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. * @param param parameter, may be null. */ public static void entering(final Logger logger, final String sourceClass, final String sourceMethod, final String param) { if (logger.isDebugEnabled()) { String msg = sourceClass + "." + sourceMethod + " ENTRY " + param; logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, msg, null)); } }
/** * Log an exiting message with result at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. * @param result result, may be null. */ public static void exiting( final Logger logger, final String sourceClass, final String sourceMethod, final String result) { if (logger.isDebugEnabled()) { logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, sourceClass + "." + sourceMethod + " RETURN " + result, null)); } }
/** * Logs a throwing message at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. * @param thrown throwable, may be null. */ public static void throwing( final Logger logger, final String sourceClass, final String sourceMethod, final Throwable thrown) { if (logger.isDebugEnabled()) { logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, sourceClass + "." + sourceMethod + " THROW", thrown)); } } }
/** * Log an entering message with a parameter at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. * @param param parameter, may be null. */ public static void entering(final Logger logger, final String sourceClass, final String sourceMethod, final Object param) { if (logger.isDebugEnabled()) { String msg = sourceClass + "." + sourceMethod + " ENTRY "; if (param == null) { msg += "null"; } else { try { msg += param; } catch(Throwable ex) { msg += "?"; } } logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, msg, null)); } }
/** * Log an exiting message with result at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. * @param result result, may be null. */ public static void exiting( final Logger logger, final String sourceClass, final String sourceMethod, final Object result) { if (logger.isDebugEnabled()) { String msg = sourceClass + "." + sourceMethod + " RETURN "; if (result == null) { msg += "null"; } else { try { msg += result; } catch(Throwable ex) { msg += "?"; } } logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, msg, null)); } }
public void onMessage(javax.jms.Message message) { LoggingEvent event; Logger remoteLogger; try { if(message instanceof ObjectMessage) { ObjectMessage objectMessage = (ObjectMessage) message; event = (LoggingEvent) objectMessage.getObject(); remoteLogger = Logger.getLogger(event.getLoggerName()); remoteLogger.callAppenders(event); } else { logger.warn("Received message is of type "+message.getJMSType() +", was expecting ObjectMessage."); } } catch(JMSException jmse) { logger.error("Exception thrown while processing incoming message.", jmse); } }
msg += "{}"; logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, msg, null));
remoteLogger.callAppenders(event);
public void log(LoggingEvent event) { Level log4jLevel = toLog4jLevel(event.getLevel().toInt()); if (!logger.isEnabledFor(log4jLevel)) return; org.apache.log4j.spi.LoggingEvent log4jevent = toLog4jEvent(event, log4jLevel); logger.callAppenders(log4jevent); }
remoteLogger.callAppenders(event);
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. */ private static void forcedLog(final Logger logger, final Level level, final String msg) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, null)); }
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. */ private static void forcedLog(final Logger logger, final Level level, final String msg) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, null)); }
/** * Log an exiting message at DEBUG level. * * @param logger logger, may not be null. * @param sourceClass source class, may be null. * @param sourceMethod method, may be null. */ public static void exiting(final Logger logger, final String sourceClass, final String sourceMethod) { if (logger.isDebugEnabled()) { logger.callAppenders(new LoggingEvent(FQCN, logger, Level.DEBUG, sourceClass + "." + sourceMethod + " RETURN", null)); } }
/** * Equivalent of Logger.forcedLog. * * @param logger logger, may not be null. * @param level level, may not be null. * @param msg message, may be null. * @param t throwable. */ private static void forcedLog(final Logger logger, final Level level, final String msg, final Throwable t) { logger.callAppenders(new LoggingEvent(FQCN, logger, level, msg, t)); } /**