public class LoggingExceptionHandler extends Object implements IExceptionHandler<Throwable>, IHasErrorLevel
IExceptionHandler interface, that
logs all exceptions to a standard logger.| Constructor and Description |
|---|
LoggingExceptionHandler() |
LoggingExceptionHandler(EErrorLevel eErrorLevel) |
| Modifier and Type | Method and Description |
|---|---|
EErrorLevel |
getErrorLevel() |
protected String |
getLogMessage(Throwable t)
Get the text to be logged for a certain exception
|
protected boolean |
isLogException(Throwable t)
Check if the passed exception should be part of the log entry.
|
void |
onException(Throwable t)
Called when an exception of the specified type occurred.
|
String |
toString() |
public LoggingExceptionHandler()
public LoggingExceptionHandler(@Nonnull EErrorLevel eErrorLevel)
@Nonnull public EErrorLevel getErrorLevel()
getErrorLevel in interface IHasErrorLevelnull.@Nonnull @Nonempty @OverrideOnDemand protected String getLogMessage(@Nullable Throwable t)
t - The exception to be logged. May theoretically be null.null nor empty.@OverrideOnDemand protected boolean isLogException(@Nullable Throwable t)
t - The exception to check. May theoretically be null.true to log the exception, false to not
log itpublic void onException(@Nullable Throwable t)
IExceptionHandleronException in interface IExceptionHandler<Throwable>t - The exception. Never null.Copyright © 2006–2015 phloc systems. All rights reserved.