Skip to content

Support multiple logging endpoints #3430

@sporksmith

Description

@sporksmith

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-level continues to specify the verbosity of stdout logging, and continues to have a default level of INFO
  • 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 INFO level, 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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: EnhancementNew functionality or improved design

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions