Top Description Inners Fields Constructors Methods
io.undertow.servlet.api

public Class LoggingExceptionHandler

extends Object
implements ExceptionHandler
Class Inheritance
All Implemented Interfaces
io.undertow.servlet.api.ExceptionHandler
Imports
io.undertow.UndertowLogger, io.undertow.server.HttpServerExchange, io.undertow.servlet.ExceptionLog, org.jboss.logging.BasicLogger, .Logger, java.io.IOException, java.util.Collections, .HashMap, .Map, jakarta.servlet.ServletRequest, .ServletResponse

An exception handler that
Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class

Field Summary

Modifier and TypeField and Description
public static final LoggingExceptionHandler
private final Map<Class<? extends Throwable>, LoggingExceptionHandler.ExceptionDetails>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static LoggingExceptionHandler.Builder
private void
handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category)

public boolean
handleThrowable(HttpServerExchange
The exchange
exchange
,
ServletRequest
The request
request
,
ServletResponse
The response
response
,
Throwable
The exception
t
)

Implements io.undertow.servlet.api.ExceptionHandler.handleThrowable.

Handles an exception.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final LoggingExceptionHandler DEFAULT
exceptionDetailsback to summary
private final Map<Class<? extends Throwable>, LoggingExceptionHandler.ExceptionDetails> exceptionDetails

Constructor Detail

LoggingExceptionHandlerback to summary
public LoggingExceptionHandler(Map<Class<? extends Throwable>, LoggingExceptionHandler.ExceptionDetails> exceptionDetails)

Method Detail

builderback to summary
public static LoggingExceptionHandler.Builder builder()
handleCustomLogback to summary
private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category)
handleThrowableback to summary
public boolean handleThrowable(HttpServerExchange exchange, ServletRequest request, ServletResponse response, Throwable t)

Implements io.undertow.servlet.api.ExceptionHandler.handleThrowable.

Doc from io.undertow.servlet.api.ExceptionHandler.handleThrowable.

Handles an exception. If this method returns true then the request/response cycle is considered to be finished, and no further action will take place, if this returns false then standard error page redirect will take place. The default implementation of this simply logs the exception and returns false, allowing error page and async context error handling to proceed as normal.

Parameters
exchange:HttpServerExchange

The exchange

request:ServletRequest

The request

response:ServletResponse

The response

t:Throwable

The exception

Returns:boolean

true true if the error was handled by this method

Annotations
@Override
io.undertow.servlet.api back to summary

public final Class LoggingExceptionHandler.Builder

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final Map<Class<? extends Throwable>, LoggingExceptionHandler.ExceptionDetails>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public LoggingExceptionHandler.Builder
add(Class<? extends Throwable> exception, String category, Logger.Level level)

public LoggingExceptionHandler.Builder
add(Class<? extends Throwable> exception, String category)

public LoggingExceptionHandler.Builder
add(Class<? extends Throwable> exception, String category, Logger.Level level, Logger.Level stackTraceLevel)

public LoggingExceptionHandler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exceptionDetailsback to summary
private final Map<Class<? extends Throwable>, LoggingExceptionHandler.ExceptionDetails> exceptionDetails

Constructor Detail

Builderback to summary
pack-priv Builder()

Method Detail

addback to summary
public LoggingExceptionHandler.Builder add(Class<? extends Throwable> exception, String category, Logger.Level level)
addback to summary
public LoggingExceptionHandler.Builder add(Class<? extends Throwable> exception, String category)
addback to summary
public LoggingExceptionHandler.Builder add(Class<? extends Throwable> exception, String category, Logger.Level level, Logger.Level stackTraceLevel)
buildback to summary
public LoggingExceptionHandler build()
io.undertow.servlet.api back to summary

private Class LoggingExceptionHandler.ExceptionDetails

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.servlet.api.LoggingExceptionHandler.ExceptionDetails

Field Summary

Modifier and TypeField and Description
pack-priv final String
pack-priv final Logger.Level
pack-priv final Logger.Level

Constructor Summary

AccessConstructor and Description
private
ExceptionDetails(Logger.Level level, Logger.Level stackTraceLevel, String category)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

categoryback to summary
pack-priv final String category
levelback to summary
pack-priv final Logger.Level level
stackTraceLevelback to summary
pack-priv final Logger.Level stackTraceLevel

Constructor Detail

ExceptionDetailsback to summary
private ExceptionDetails(Logger.Level level, Logger.Level stackTraceLevel, String category)