Top Constructors Methods
ch.qos.logback.classic.pattern

public Class EnsureExceptionHandling

extends Object
implements PostCompileProcessor<ILoggingEvent>
Class Inheritance
All Implemented Interfaces
ch.qos.logback.core.pattern.PostCompileProcessor
Imports
ch.qos.logback.classic.LoggerContext, ch.qos.logback.classic.spi.ILoggingEvent, ch.qos.logback.core.Context, ch.qos.logback.core.pattern.CompositeConverter, .Converter, .ConverterUtil, .PostCompileProcessor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if it can handle throwables contained in logging events
chainHandlesThrowable
(Converter<ILoggingEvent>
The first element of the chain
head
)

This method computes whether a chain of converters handles exceptions or not.

public boolean

Returns:

true if it can handle throwables contained in logging events
compositeHandlesThrowable
(CompositeConverter<ILoggingEvent>
The composite converter
compositeConverter
)

This method computes whether a composite converter handles exceptions or not.

public void
process(Context context, Converter<ILoggingEvent>
The first converter in the chain
head
)

Implements ch.qos.logback.core.pattern.PostCompileProcessor.process.

This implementation checks if any of the converters in the chain handles exceptions.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

EnsureExceptionHandlingback to summary
public EnsureExceptionHandling()

Method Detail

chainHandlesThrowableback to summary
public boolean chainHandlesThrowable(Converter<ILoggingEvent> head)

This method computes whether a chain of converters handles exceptions or not.

Parameters
head:Converter<ILoggingEvent>

The first element of the chain

Returns:boolean

true if it can handle throwables contained in logging events

compositeHandlesThrowableback to summary
public boolean compositeHandlesThrowable(CompositeConverter<ILoggingEvent> compositeConverter)

This method computes whether a composite converter handles exceptions or not.

Parameters
compositeConverter:CompositeConverter<ILoggingEvent>

The composite converter

Returns:boolean

true if it can handle throwables contained in logging events

processback to summary
public void process(Context context, Converter<ILoggingEvent> head)

Implements ch.qos.logback.core.pattern.PostCompileProcessor.process.

This implementation checks if any of the converters in the chain handles exceptions. If not, then this method adds a ExtendedThrowableProxyConverter instance to the end of the chain.

This allows appenders using this layout to output exception information event if the user forgets to add %ex to the pattern. Note that the appenders defined in the Core package are not aware of exceptions nor LoggingEvents.

If for some reason the user wishes to NOT print exceptions, then she can add %nopex to the pattern.

Parameters
head:Converter<ILoggingEvent>

Doc from ch.qos.logback.core.pattern.PostCompileProcessor.process.

The first converter in the chain