Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Establish a standard logging format through this library, with the ability to customize #113

Open
grahamalama opened this issue Apr 23, 2024 · 0 comments

Comments

@grahamalama
Copy link
Contributor

Though we want to add the ability to emit logs in the format that's most useful for engineers (see #111), we also want to promote a standard logging format to reduce the cognitive overhead of switching between projects and provide the ability to more-easily search for logs that span multiple services.

The idea would be that instead of encouraging engineers to reference a format-specific class in their logging configuration (e.g. dockerflow.logging.MozlogHandler or google.cloud.logging.handlers.StructuredLogHandler), we can establish a generic class name like:

'console': {
    'class': 'dockerflow.logging.DefaultHandler', #real name tbd
},

with some sort of ability to configure the class through an environment variable, like:

os.getenv("DOCKERFLOW_LOGGING_FORMAT", "MOZLOG")

With this setup, engineers have the freedom to:

  • accept the default format of DefaultHandler as the "current logging format standard of Mozilla".
    • maintainers of this library can change the format of DefaultHandler in accordance with the current logging standard of Mozilla, and if engineers only care about aligning with Mozilla's standard logging format, they'll automatically be compliant with the standard when they update this library
  • override the standard format to another commonly used format through environment configuration, like
export DOCKERFLOW_LOGGING_FORMAT=GCP
  • still (of course) have the ability to fully customize their logging setup by referencing specific logging handlers, formatters, and filters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant