-
Notifications
You must be signed in to change notification settings - Fork 268
Support multiple logging endpoints #3430
Description
From discussion: #3428 (comment)
Currently logging is done primarily to stdout. This is overwhelming even at the default level of INFO, which can be annoying and make it easy to miss WARN and ERROR logs.
A typical workaround is to redirect stdout to a file. We've added some features to shadow to make that use-case a little nicer, printing progress and notification of errors to stderr, but the latter is a little bit ad-hoc.
I think we want the typical default to be for relatively verbose logs (INFO?) to go to a file in the data directory (e.g. shadow.data/log.txt), and for relatively high priority logs (WARN? ERROR?) to go to stdout or stderr.
The user should be able to at least override the default verbosity of those destinations, and maybe even specify an arbitrary list of destinations and verbosity levels.
There is a potential migration path where we add this feature without a MAJOR version bump:
--log-levelcontinues to specify the verbosity ofstdoutlogging, and continues to have a default level ofINFO- We add support for also logging to a file in the data directory, and perhaps turn this on by default. This would probably also be
INFOlevel, since any higher may have performance implications.
When we're ready for a breaking change, the default level logged to stdout should probably be made less verbose. (And maybe sent to stderr instead?)