@Override public Exception getException() { Exception exception = null; if (isException()) { Throwable throwable = ((ThrowableProxy)this.loggingEvent.getThrowableProxy()).getThrowable(); exception = throwable instanceof Exception ? (Exception) throwable : new Exception(throwable); } return exception; }
@Override public Exception getException() { Exception exception = null; if (isException()) { Throwable throwable = ((ThrowableProxy)this.loggingEvent.getThrowableProxy()).getThrowable(); exception = throwable instanceof Exception ? (Exception) throwable : new Exception(throwable); } return exception; }
@Override public Map<String, String> getCustomParameters() { Map<String, String> metaData = new HashMap<String, String>(); metaData.put("SourceType", "LOGBack"); addLogEventProperty("LoggerName", loggingEvent.getLoggerName(), metaData); addLogEventProperty("LoggingLevel", loggingEvent.getLevel() != null ? loggingEvent.getLevel().levelStr : null, metaData); addLogEventProperty("ThreadName", loggingEvent.getThreadName(), metaData); addLogEventProperty("TimeStamp", getFormattedDate(loggingEvent.getTimeStamp()), metaData); if (isException()) { addLogEventProperty("Logger Message", getMessage(), metaData); } for (Map.Entry<String, String> entry : loggingEvent.getMDCPropertyMap().entrySet()) { addLogEventProperty(entry.getKey(), entry.getValue(), metaData); } // TODO: No location info? // TODO: Username, domain and identity should be included as in .NET version. // TODO: Should check, seems that it is not included in Log4j2. return metaData; }
@Override public Map<String, String> getCustomParameters() { Map<String, String> metaData = new HashMap<String, String>(); metaData.put("SourceType", "LOGBack"); addLogEventProperty("LoggerName", loggingEvent.getLoggerName(), metaData); addLogEventProperty("LoggingLevel", loggingEvent.getLevel() != null ? loggingEvent.getLevel().levelStr : null, metaData); addLogEventProperty("ThreadName", loggingEvent.getThreadName(), metaData); addLogEventProperty("TimeStamp", getFormattedDate(loggingEvent.getTimeStamp()), metaData); if (isException()) { addLogEventProperty("Logger Message", getMessage(), metaData); } for (Map.Entry<String, String> entry : loggingEvent.getMDCPropertyMap().entrySet()) { addLogEventProperty(entry.getKey(), entry.getValue(), metaData); } // TODO: No location info? // TODO: Username, domain and identity should be included as in .NET version. // TODO: Should check, seems that it is not included in Log4j2. return metaData; }