Package de.christofreichardt.diagnosis
Class Log4j2Router
- java.lang.Object
-
- de.christofreichardt.diagnosis.AbstractTracer
-
- de.christofreichardt.diagnosis.NullTracer
-
- de.christofreichardt.diagnosis.Log4j2Router
-
public class Log4j2Router extends NullTracer
A specializedNullTracerwhich delegates log messages to Log4j2 loggers. For more information about Log4j2, see Apache Log4j.- Author:
- Christof Reichardt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.christofreichardt.diagnosis.AbstractTracer
AbstractTracer.Exception
-
-
Field Summary
-
Fields inherited from class de.christofreichardt.diagnosis.AbstractTracer
VERSION
-
-
Constructor Summary
Constructors Constructor Description Log4j2Router()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidlogException(LogLevel logLevel, Throwable throwable, Class<?> clazz, String methodName)This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz.voidlogMessage(LogLevel logLevel, String message, Class<?> clazz, String methodName)This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz.-
Methods inherited from class de.christofreichardt.diagnosis.NullTracer
close, entry, entry, entry, initCurrentTracingContext, initCurrentTracingContext, open, out, out, readConfiguration, wayout
-
Methods inherited from class de.christofreichardt.diagnosis.AbstractTracer
clearCurrentTracingContext, formatStreamErrorState, formatVersionInfo, getBufferedOutputStream, getBufferSize, getLevel, getName, getNullPrintStream, getThreadMap, getTracePrintStream, isAutoflush, isOnline, isOpened, setAutoflush, setBufferedOutputStream, setBufferSize, setOpened, setTracePrintStream
-
-
-
-
Method Detail
-
logMessage
public void logMessage(LogLevel logLevel, String message, Class<?> clazz, String methodName)
This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz. Thereupon theExtendedLoggerwill be used to log the given message.- Overrides:
logMessagein classNullTracer- Parameters:
logLevel- will be converted to Log4j2s levelmessage- the to be logged messageclazz- the originating classmethodName- the originating method
-
logException
public void logException(LogLevel logLevel, Throwable throwable, Class<?> clazz, String methodName)
This method gets itself a Log4j2 ExtendedLogger by invoking Log4j2s LogManager with the given clazz. Thereupon theExtendedLoggerwill be used to log the given throwable.- Overrides:
logExceptionin classNullTracer- Parameters:
logLevel- will be converted to Log4j2s levelthrowable- the to be logged throwableclazz- the originating classmethodName- the name of the relevant method
-
-