• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Spring cloud sleuth to log URIs and corresponding HTTP verbs for each RestTemplate calls

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am integrating Spring cloud Sleuth into our existing project to add trace-id and span-id in the logs. The project is built using Spring boot v2.5.6 and Spring cloud version v2020.0.6. After adding the dependencies and overriding the property

logging.pattern.level=%5p

in application.properties, I am seeing the logs with trace-id and span-id in a custom format. Now I am trying to improve the logging to also include URIs and corresponding HTTP Verb for each REST call. After going through Sleuth docs, it seems slueth does not have an out-of-the box solution for this.

Can anyone please guide me how do I log URI and HTTP Verb for each Rest calls? Currently, We are using RestTemplate using new keywords. RestTemplate is not registered as Bean. Please provide some guidance or direction to log these details.

TIA..
 
Bartender
Posts: 2436
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if you want to try Elasticsearch and Kibana's logging tool and visualization tool to see your logs.
I hope these third party tool can help.
 
Jagan Mohan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:I am not sure if you want to try Elasticsearch and Kibana's logging tool and visualization tool to see your logs.
I hope these third party tool can help.



Thanks for the reply. But unfortunately we can't, at this point integrate our system with ELK as usage of this.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic