Top Description Fields Constructors Methods
org.apache.logging.log4j.jul

pack-priv Class WrappedLogger

extends ExtendedLoggerWrapper
Class Inheritance
Imports
org.apache.logging.log4j.Level, org.apache.logging.log4j.spi.ExtendedLogger, .ExtendedLoggerWrapper

Wrapper class to ensure proper FQCN support in Logger calls.
Since
2.1

Field Summary

Modifier and TypeField and Description
private static final String
private static final long
Inherited from org.apache.logging.log4j.spi.ExtendedLoggerWrapper:
logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
entry(final Object...
The parameters to the method.
params
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.entry.

Implements org.apache.logging.log4j.Logger.entry.

Logs entry to a method along with its parameters (consider using one of the traceEntry(...) methods instead.)

For example:

public void doSomething(String foo, int bar) {
    LOGGER.entry(foo, bar);
    // do something
}
public void
public <R> R
exit(final R
The result being returned from the method call.
result
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.exit.

Implements org.apache.logging.log4j.Logger.exit.

Logs exiting from a method with the result.

public void
log(final Level
the logging level
level
,
final String
the message to log.
message
,
final Throwable
the Throwable to log, including its stack trace.
t
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Logs a message at the given level including the stack trace of the Throwable throwable passed as parameter.

public void
log(final Level
the logging level
level
,
final String
the message to log; the format depends on the message factory.
message
,
final Object...
parameters to the message.
params
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Logs a message with parameters at the given level.

public void
log(final Level
the logging level
level
,
final String
the message string to log.
message
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Logs a message object with the given level.

public <T extends Throwable> T
throwing(final T
The Throwable.
t
)

Overrides org.apache.logging.log4j.spi.AbstractLogger.throwing.

Implements org.apache.logging.log4j.Logger.throwing.

Logs a Throwable to be thrown at the ERROR level.

Inherited from org.apache.logging.log4j.spi.ExtendedLoggerWrapper:
getLevelisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledlogMessage

Field Detail

FQCNback to summary
private static final String FQCN

Hides org.apache.logging.log4j.spi.AbstractLogger.FQCN.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.logging.log4j.spi.ExtendedLoggerWrapper.serialVersionUID.

Constructor Detail

WrappedLoggerback to summary
pack-priv WrappedLogger(final ExtendedLogger logger)

Method Detail

entryback to summary
public void entry()

Overrides org.apache.logging.log4j.spi.AbstractLogger.entry.

Implements org.apache.logging.log4j.Logger.entry.

Doc from org.apache.logging.log4j.Logger.entry.

Logs entry to a method. Used when the method in question has no parameters or when the parameters should not be logged.

Annotations
@Override
entryback to summary
public void entry(final Object... params)

Overrides org.apache.logging.log4j.spi.AbstractLogger.entry.

Implements org.apache.logging.log4j.Logger.entry.

Doc from org.apache.logging.log4j.Logger.entry.

Logs entry to a method along with its parameters (consider using one of the traceEntry(...) 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.

Parameters
params:Object[]

The parameters to the method.

Annotations
@Override
exitback to summary
public void exit()

Overrides org.apache.logging.log4j.spi.AbstractLogger.exit.

Implements org.apache.logging.log4j.Logger.exit.

Doc from org.apache.logging.log4j.Logger.exit.

Logs exit from a method. Used for methods that do not return anything.

Annotations
@Override
exitback to summary
public <R> R exit(final R result)

Overrides org.apache.logging.log4j.spi.AbstractLogger.exit.

Implements org.apache.logging.log4j.Logger.exit.

Doc from org.apache.logging.log4j.Logger.exit.

Logs exiting from a method with the result. This may be coded as:

return LOGGER.exit(myResult);
Parameters
<R>
The type of the parameter and object being returned.
result:R

The result being returned from the method call.

Returns:R

the result.

Annotations
@Override
logback to summary
public void log(final Level level, final String message, final Throwable t)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Doc from org.apache.logging.log4j.Logger.log.

Logs a message at the given level including the stack trace of the Throwable throwable passed as parameter.

Parameters
level:Level

the logging level

message:String

the message to log.

t:Throwable

the Throwable to log, including its stack trace.

Annotations
@Override
logback to summary
public void log(final Level level, final String message, final Object... params)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Doc from org.apache.logging.log4j.Logger.log.

Logs a message with parameters at the given level.

Parameters
level:Level

the logging level

message:String

the message to log; the format depends on the message factory.

params:Object[]

parameters to the message.

Annotations
@Override
logback to summary
public void log(final Level level, final String message)

Overrides org.apache.logging.log4j.spi.AbstractLogger.log.

Implements org.apache.logging.log4j.Logger.log.

Doc from org.apache.logging.log4j.Logger.log.

Logs a message object with the given level.

Parameters
level:Level

the logging level

message:String

the message string to log.

Annotations
@Override
throwingback to summary
public <T extends Throwable> T throwing(final T t)

Overrides org.apache.logging.log4j.spi.AbstractLogger.throwing.

Implements org.apache.logging.log4j.Logger.throwing.

Doc from org.apache.logging.log4j.Logger.throwing.

Logs a Throwable to be thrown at the ERROR level. This may be coded as:

throw logger.throwing(myException);
Parameters
<T>
the Throwable type.
t:T

The Throwable.

Returns:T

the Throwable.

Annotations
@Override