Java Code Examples for io.undertow.UndertowLogger#REQUEST_LOGGER
The following examples show how to use
io.undertow.UndertowLogger#REQUEST_LOGGER .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoggingExceptionHandler.java From quarkus-http with Apache License 2.0 | 6 votes |
private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category) { BasicLogger logger = UndertowLogger.REQUEST_LOGGER; if (!category.isEmpty()) { logger = Logger.getLogger(category); } boolean stackTrace = true; if (stackTraceLevel.ordinal() > level.ordinal()) { if (!logger.isEnabled(stackTraceLevel)) { stackTrace = false; } } if (stackTrace) { logger.logf(level, t, "Exception handling request to %s", exchange.getRequestURI()); } else { logger.logf(level, "Exception handling request to %s: %s", exchange.getRequestURI(), t.getMessage()); } }
Example 2
Source File: QuarkusExceptionHandler.java From quarkus with Apache License 2.0 | 6 votes |
private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category, String uid) { BasicLogger logger = UndertowLogger.REQUEST_LOGGER; if (!category.isEmpty()) { logger = Logger.getLogger(category); } boolean stackTrace = true; if (stackTraceLevel.ordinal() > level.ordinal()) { if (!logger.isEnabled(stackTraceLevel)) { stackTrace = false; } } if (stackTrace) { logger.logf(level, t, "Exception handling request %s to %s", uid, exchange.getRequestURI()); } else { logger.logf(level, "Exception handling request %s to %s: %s", uid, exchange.getRequestURI(), t.getMessage()); } }
Example 3
Source File: LoggingExceptionHandler.java From lams with GNU General Public License v2.0 | 6 votes |
private void handleCustomLog(HttpServerExchange exchange, Throwable t, Logger.Level level, Logger.Level stackTraceLevel, String category) { BasicLogger logger = UndertowLogger.REQUEST_LOGGER; if (!category.isEmpty()) { logger = Logger.getLogger(category); } boolean stackTrace = true; if (stackTraceLevel.ordinal() > level.ordinal()) { if (!logger.isEnabled(stackTraceLevel)) { stackTrace = false; } } if (stackTrace) { logger.logf(level, t, "Exception handling request to %s", exchange.getRequestURI()); } else { logger.logf(level, "Exception handling request to %s: %s", exchange.getRequestURI(), t.getMessage()); } }