Package org.apache.logging.log4j.jul
Class WrappedLogger
java.lang.Object
org.apache.logging.log4j.spi.AbstractLogger
org.apache.logging.log4j.spi.ExtendedLoggerWrapper
org.apache.logging.log4j.jul.WrappedLogger
- All Implemented Interfaces:
Serializable,Logger,ExtendedLogger,LocationAwareLogger
Wrapper class to ensure proper FQCN support in Logger calls.
- Since:
- 2.1
-
Field Summary
FieldsFields inherited from class org.apache.logging.log4j.spi.ExtendedLoggerWrapper
loggerFields inherited from class org.apache.logging.log4j.spi.AbstractLogger
CATCHING_MARKER, DEFAULT_FLOW_MESSAGE_FACTORY_CLASS, DEFAULT_MESSAGE_FACTORY_CLASS, ENTRY_MARKER, EXCEPTION_MARKER, EXIT_MARKER, FLOW_MARKER, logBuilder, name, THROWING_MARKER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidentry()Logs entry to a method.voidLogs entry to a method along with its parameters (consider using one of thetraceEntry(...)methods instead.)voidexit()Logs exit from a method.<R> Rexit(R result) Logs exiting from a method with the result.voidLogs a message object with the given level.voidLogs a message with parameters at the given level.voidLogs a message at the given level including the stack trace of theThrowablethrowablepassed as parameter.<T extends Throwable>
Tthrowing(T t) Methods inherited from class org.apache.logging.log4j.spi.ExtendedLoggerWrapper
getLevel, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, logMessageMethods inherited from class org.apache.logging.log4j.spi.AbstractLogger
always, atDebug, atError, atFatal, atInfo, atLevel, atTrace, atWarn, catching, catching, catching, catchingMsg, checkMessageFactory, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, enter, enter, enter, enter, enter, entry, entryMsg, entryMsg, entryMsg, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, error, exit, exit, exitMsg, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, fatal, getMessageFactory, getName, getRecursionDepth, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isEnabled, isEnabled, isErrorEnabled, isErrorEnabled, isFatalEnabled, isFatalEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logIfEnabled, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, logMessage, printf, printf, requiresLocation, throwing, throwing, throwingMsg, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, trace, traceEntry, traceEntry, traceEntry, traceEntry, traceEntry, traceExit, traceExit, traceExit, traceExit, traceExit, traceExit, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FQCN
-
-
Constructor Details
-
WrappedLogger
WrappedLogger(ExtendedLogger logger)
-
-
Method Details
-
log
Description copied from interface:LoggerLogs a message at the given level including the stack trace of theThrowablethrowablepassed as parameter.- Specified by:
login interfaceLogger- Overrides:
login classAbstractLogger- Parameters:
level- the logging levelmessage- the message to log.t- theThrowableto log, including its stack trace.
-
log
Description copied from interface:LoggerLogs a message with parameters at the given level.- Specified by:
login interfaceLogger- Overrides:
login classAbstractLogger- Parameters:
level- the logging levelmessage- the message to log; the format depends on the message factory.params- parameters to the message.- See Also:
-
log
Description copied from interface:LoggerLogs a message object with the given level.- Specified by:
login interfaceLogger- Overrides:
login classAbstractLogger- Parameters:
level- the logging levelmessage- the message string to log.
-
entry
public void entry()Description copied from interface:LoggerLogs entry to a method. Used when the method in question has no parameters or when the parameters should not be logged.- Specified by:
entryin interfaceLogger- Overrides:
entryin classAbstractLogger
-
entry
Description copied from interface:LoggerLogs entry to a method along with its parameters (consider using one of thetraceEntry(...)methods instead.)For example:
public void doSomething(String foo, int bar) { LOGGER.entry(foo, bar); // do something }The use of methods such as this are more effective when combined with aspect-oriented programming or other bytecode manipulation tools. It can be rather tedious (and messy) to use this type of method manually.
- Specified by:
entryin interfaceLogger- Overrides:
entryin classAbstractLogger- Parameters:
params- The parameters to the method.
-
exit
public void exit()Description copied from interface:LoggerLogs exit from a method. Used for methods that do not return anything.- Specified by:
exitin interfaceLogger- Overrides:
exitin classAbstractLogger
-
exit
public <R> R exit(R result) Description copied from interface:LoggerLogs exiting from a method with the result. This may be coded as:return LOGGER.exit(myResult);
- Specified by:
exitin interfaceLogger- Overrides:
exitin classAbstractLogger- Type Parameters:
R- The type of the parameter and object being returned.- Parameters:
result- The result being returned from the method call.- Returns:
- the result.
-
throwing
Description copied from interface:LoggerLogs aThrowableto be thrown at theERRORlevel. This may be coded as:throw logger.throwing(myException);
- Specified by:
throwingin interfaceLogger- Overrides:
throwingin classAbstractLogger- Type Parameters:
T- the Throwable type.- Parameters:
t- The Throwable.- Returns:
- the Throwable.
-