up
This commit is contained in:
@@ -140,6 +140,19 @@ public class MainVerticle extends AbstractVerticle {
|
||||
}
|
||||
});
|
||||
|
||||
router.route().handler(ctx -> {
|
||||
long start = System.currentTimeMillis();
|
||||
String method = ctx.request().method().name();
|
||||
String path = ctx.request().path();
|
||||
String remoteIp = ctx.request().remoteAddress() != null ? ctx.request().remoteAddress().host() : "unknown";
|
||||
ctx.addBodyEndHandler(v -> {
|
||||
long duration = System.currentTimeMillis() - start;
|
||||
log.info("{} {} - {} ms - {} - {}",
|
||||
method, path, duration, ctx.response().getStatusCode(), remoteIp);
|
||||
});
|
||||
ctx.next();
|
||||
});
|
||||
|
||||
// ------ Раздаём Vue статику ------
|
||||
router.route("/assets/*").handler(StaticHandler.create("webroot/assets"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user