beatlabs / patron

Microservice framework following best cloud practices with a focus on productivity.
Apache License 2.0
123 stars 67 forks source link

Change log level at runtime #155

Open cioboteacristian opened 4 years ago

cioboteacristian commented 4 years ago

Feature request

It would be very useful to be able to change the log level at runtime. For example, we started our service with LOG_LEVEL=info. But, we've observed that we have a bug in our service, and we would like to get more data on our service by switching the LOG_LEVEL=debug for a couple of minutes and analyze the logs.

Describe the solution

A possible solution would be to have an admin endpoint /admin/log?level=TRUE. We need to investigate how to propagate this change to patron log and handle this "state"

An example of such feature is in Dropwizard, a Java REST WS: https://github.com/stuartgunter/dropwizard-logging-config/blob/master/README.md#configure-a-user-defined-log-level-for-a-single-logger, where you can change loglevel, but also log implementation on the fly.

Stefos commented 4 years ago

I'd like to have a look at this.

oss92 commented 3 years ago

Is there any update on that one? It seems like a very nice addition and we often need it.

mantzas commented 3 years ago

@oss92 we had @Stefos some time ago interested in this. Maybe if this is something that you can discuss with him?