0

Currently, my logs are printing like this below

 [2020-06-06 HH:MM:SS] [INFO] [https-nio-9005-exec-2] [com.test.restcall]-[hello world]

I need to get the same log like below:

[2020-06-06 HH:MM:SS] [INFO] [GET/firstapplication/my-app] [com.test.restcall]-[hello world]

Can anyone help me in getting this??

Note: using logback, dropwizard application,

%-4relative [%thread] %-5level %logger{35} - %msg%n

vnjapa
  • 11
  • 4
  • The duplicate answer [linked up top](https://stackoverflow.com/a/6116385/5221149) shows how to use a Servlet Filter to log user name. You can easily modify that to capture the HTTP Method + Path instead. Depending on which REST framework you're using, you can use something other than a Servlet Filter, e.g. in Jersey you can use a Request Filter or an Interceptor. – Andreas Jun 06 '20 at 06:35
  • `%thread` by definition prints the thread-name. – Mark Rotteveel Jun 06 '20 at 07:14
  • @MarkRotteveel so how where/how do i need to configure to get like that – vnjapa Jun 06 '20 at 07:15
  • See the duplicate. – Mark Rotteveel Jun 06 '20 at 07:20

0 Answers0