英文:
How to avoid the console log for each request in a java Servlet?
问题
我有一个Dropwizard应用程序,使用一个Servlet,每个对Servlet的请求都会像这样记录到控制台:
0:0:0:0:0:0:0:1 - - [15/Oct/2020:07:46:43 +0000] "GET /myServletUrl/subUrl/test?foo=var HTTP/1.1" 200 113 "-" "PostmanRuntime/7.26.5" 3169
我已经按照通常的方式在yaml中配置了Dropwizard的日志记录,并且它也起作用了(我在Servlet中展示的日志就像配置中所说的那样)。但是我无法避免这种奇怪的日志... 有任何想法吗?
谢谢!
英文:
I have a dropwizard application, using a servlet, and every request to the servlet is logged to the console like this:
0:0:0:0:0:0:0:1 - - [15/Oct/2020:07:46:43 +0000] "GET /myServletUrl/subUrl/test?foo=var HTTP/1.1" 200 113 "-" "PostmanRuntime/7.26.5" 3169
I have configured the logging of dropwizard in a yaml, as always, and it works (the logs that I show in the servlet works like the config said). But I can't avoid that strange log... ¿any ideas?
Thanks!
答案1
得分: 0
好的,我找到了问题。这个日志来自于Jetty和Dropwizard,不是来自服务器。它被称为"requestLog",你可以在Dropwizard的配置中进行配置(当然也可以禁用)。
就像这样:
https://stackoverflow.com/questions/23505403/turning-off-requestlog
英文:
Ok, I found the problem. The log is from jetty and dropwizard, not from the server. Is called "requestLog" and you can configure it (and disable too, of course) in the dropwizard configuration.
Like here:
https://stackoverflow.com/questions/23505403/turning-off-requestlog
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论