Skip to content

Commit

Permalink
UNDERTOW-557 Undertow missing jboss logging internationalization
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Oct 17, 2015
1 parent 6c63757 commit 2841d94
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
12 changes: 12 additions & 0 deletions core/src/main/java/io/undertow/UndertowLogger.java
Expand Up @@ -19,6 +19,7 @@
package io.undertow;

import io.undertow.client.ClientConnection;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.ServerConnection;
import io.undertow.util.HeaderMap;
import io.undertow.util.HttpString;
Expand Down Expand Up @@ -326,4 +327,15 @@ void nodeConfigCreated(URI connectionURI, String balancer, String domain, String
@Message(id = 5068, value = "Pattern was just empty or whitespace")
void extendedAccessLogEmptyPattern();

@LogMessage(level = ERROR)
@Message(id = 5069, value = "Failed to write JDBC access log")
void failedToWriteJdbcAccessLog(@Cause SQLException e);

@LogMessage(level = ERROR)
@Message(id = 5070, value = "Failed to write pre-cached file")
void failedToWritePreCachedFile();

@LogMessage(level = ERROR)
@Message(id = 5071, value = "Undertow request failed %s")
void undertowRequestFailed(@Cause Throwable t, HttpServerExchange exchange);
}
Expand Up @@ -407,7 +407,6 @@ protected FrameHeaderData parseFrame(ByteBuffer data) throws IOException {
sb.append(data.get());
sb.append(" ");
}
UndertowLogger.REQUEST_IO_LOGGER.error("Buffer: " + sb.toString());
markReadsBroken(new IOException());
} else {
initialSettingsReceived = true;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/undertow/server/Connectors.java
Expand Up @@ -218,7 +218,7 @@ public static void executeRootHandler(final HttpHandler handler, final HttpServe
if (!exchange.isResponseStarted()) {
exchange.setStatusCode(StatusCodes.INTERNAL_SERVER_ERROR);
}
UndertowLogger.REQUEST_LOGGER.errorf(t, "Undertow request failed %s", exchange);
UndertowLogger.REQUEST_LOGGER.undertowRequestFailed(t, exchange);
exchange.endExchange();
}
}
Expand Down
Expand Up @@ -215,7 +215,7 @@ private void writeMessage(List<JDBCLogAttribute> messages) {
ps.executeUpdate();
numberOfTries = 0;
} catch (SQLException e) {
UndertowLogger.ROOT_LOGGER.error(e);
UndertowLogger.ROOT_LOGGER.failedToWriteJdbcAccessLog(e);
}
numberOfTries--;
}
Expand Down
Expand Up @@ -139,7 +139,7 @@ public ContentEncodedResource getResource(final Resource resource, final HttpSer
targetChannel.shutdownWrites();
org.xnio.channels.Channels.flushBlocking(targetChannel);
if (transferred != resource.getContentLength()) {
UndertowLogger.REQUEST_LOGGER.error("Failed to write pre-cached file");
UndertowLogger.REQUEST_LOGGER.failedToWritePreCachedFile();
}
Files.move(tempTarget, finalTarget);
encoded.invalidate(newPath);
Expand Down
Expand Up @@ -328,9 +328,6 @@ public void handleEvent(final Channel channel) {
case 0: {
// read listener
for (; ; ) {
if(buffer.hasRemaining()) {
WebSocketLogger.REQUEST_LOGGER.error("BUFFER HAS REMAINING!!!!!");
}
try {
lres = source.transferTo(Long.MAX_VALUE, buffer, sink);
} catch (IOException e) {
Expand Down

0 comments on commit 2841d94

Please sign in to comment.