How to actually do a POST to change level? #358
Replies: 8 comments 9 replies
-
|
When querying for logs it returns fine: |
Beta Was this translation helpful? Give feedback.
-
|
This is the code that gets executed? private void handlePost(HttpServerRequest request, HttpServerResponse response) {
String contentType = request.getHeader("Content-Type");
if (!"application/x-www-form-urlencoded".equals(contentType)) {
response.setStatusCode(415).end();
return;
}
String loggerName = request.getFormAttribute(LOGGER_NAME_PARAM);
String loggerLevel = request.getFormAttribute(LOGGER_LEVEL_PARAM);
if (loggerLevel == null || loggerLevel.isEmpty()) {
LogController.updateLogLevel(loggerName, null);
} else {
LogController.updateLogLevel(loggerName, loggerLevel);
}
response.setStatusCode(201).end();
}Using the actual string name of the field instead of the constant. Same same |
Beta Was this translation helpful? Give feedback.
-
|
Have you tried doing this in Swagger UI: https://github.com/quarkiverse/quarkus-logging-manager?tab=readme-ov-file#openapi If it does not work there, it;s a bug. Also try switching off the management port and see if if works in 8080. Then we can narrow it down to management port. |
Beta Was this translation helpful? Give feedback.
-
|
I also removed management port and now I get Error 404 |
Beta Was this translation helpful? Give feedback.
-
|
OK sorry I could not help. This is probably a bug (I see there is no test cases for POST). THis might be a regression. Can you create an issue with a reproducer ? That will ensure a quick fix. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
There is a bug in the way when quarkus.management is enabled. It defaults to port 9000 |
Beta Was this translation helpful? Give feedback.
-
|
Here you are https://github.com/MikaelAnderssonWigander/logging-manager-management.git |
Beta Was this translation helpful? Give feedback.
-
|
Issue created as well, #359 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I'm testing this extension out but I can't find any documentation on how to actually POST a change of logging level.
Using httpie in CLI
returns an error
{ "details": "Error id f65b375d-4da4-44ed-93f4-f9186a14479f-12, java.lang.IllegalStateException: Request has already been read", "stack": "java.lang.IllegalStateException: Request has already been read\n\tat io.vertx.core.http.impl.Http1xServerRequest.checkEnded(Http1xServerRequest.java:733)\n\tat io.vertx.core.http.impl.Http1xServerRequest.setExpectMultipart(Http1xServerRequest.java:522)\n\tat io.vertx.core.http.impl.HttpServerRequestWrapper.setExpectMultipart(HttpServerRequestWrapper.java:190)\n\tat io.vertx.core.http.impl.HttpServerRequestWrapper.setExpectMultipart(HttpServerRequestWrapper.java:190)\n\tat io.vertx.ext.web.handler.impl.BodyHandlerImpl$BHandler.<init>(BodyHandlerImpl.java:230)\n\tat io.vertx.ext.web.handler.impl.BodyHandlerImpl.handle(BodyHandlerImpl.java:126)\n\tat io.vertx.ext.web.handler.impl.BodyHandlerImpl.handle(BodyHandlerImpl.java:45)\n\tat io.quarkus.vertx.http.runtime.VertxHttpRecorder$18.handle(VertxHttpRecorder.java:1625)\n\tat io.quarkus.vertx.http.runtime.VertxHttpRecorder$18.handle(VertxHttpRecorder.java:1596)\n\tat io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1281)\n\tat io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177)\n\tat io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:151)\n\tat io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$5.handle(VertxHttpHotReplacementSetup.java:206)\n\tat io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$5.handle(VertxHttpHotReplacementSetup.java:194)\n\tat io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176)\n\tat io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60)\n\tat io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)\n\tat io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)" }Quarkus 3.19.2 and extension 3.3.2
Not sure if this is extension related or not…
Beta Was this translation helpful? Give feedback.
All reactions