0

Is there any logging framework, which helps me change logging levels dynamically based on the request parameters received ?

If request has a parameter with debug enabled to true, then only it should log, else not.

Does spring sleuth provide this feature in cloud environment?

  • Also go through spring actuator logger endpoints through which you can change the levels .https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html – Barath Sep 12 '17 at 13:53

2 Answers2

0

You can use Spring Boot & Spring Cloud Config and standard Slf4j logging mechanism. You can check out this answer for more information - Managing logging.level using ConfigServer

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32
0

If you just want conditional logging you would use a NDC/MDC and a filter using the frameworks that support that feature.

If you want something more general then for instance, setup a com.foo.request that is set to say INFO and a com.foo.request.debug that is set to some lower level. Pick and choose the logger on request parameter.

jmehrens
  • 10,580
  • 1
  • 38
  • 47