diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/webserver/HttpConnection.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/webserver/HttpConnection.java index 298e3b3f..afce1467 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/webserver/HttpConnection.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/webserver/HttpConnection.java @@ -34,6 +34,9 @@ import java.util.concurrent.TimeUnit; import de.bluecolored.bluemap.core.logger.Logger; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; public class HttpConnection implements Runnable { @@ -66,6 +69,19 @@ public void run() { HttpRequest request = acceptRequest(); HttpResponse response = handler.handle(request); sendResponse(response); + + DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + Date date = new Date(); + Logger.global.logInfo( + connection.getInetAddress().toString() + + " [ " + + dateFormat.format(date) + + " ] \"" + + request.getMethod() + + " " + request.getPath() + + " " + request.getVersion() + + "\" " + + response.getStatusCode().toString()); } catch (InvalidRequestException e){ try { sendResponse(new HttpResponse(HttpStatusCode.BAD_REQUEST));