daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
283 stars 41 forks source link

Reload config when receiving a SIGHUP #209

Open hadley opened 2 weeks ago

hadley commented 2 weeks ago

It's pretty common for loggers to reload their config when they recevie a SIGHUP. For example, the "Posit logging standard" says:

The level of logging must be configurable. There must be the ability to turn debug logging on for all or parts of the application. To make the debug logging most useful, try to allow for debug logging to be enabled without a restart. This should be done by listening for SIGHUP to reload configurations. This should work with subprocesses as well, by sending the child process the same SIGHUP signal.

It would be cool if logger supported this too.

daroczig commented 2 weeks ago

I agree it's super helpful for services to reload their configs without restarting, but I wonder what config would be reloaded for logger?

I mean, I am not aware of any file-based configuration that we could reload, but I'm sure I'm missing something here .. so please share more details :bow:

hadley commented 2 weeks ago

I was thinking of LOGGER_LOG_LEVEL env var. Not super important, but it would be a nice feature to have.