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

Best practices documentation page #139

Open
wsargent opened this issue Jun 23, 2020 · 0 comments
Open

Best practices documentation page #139

wsargent opened this issue Jun 23, 2020 · 0 comments

Comments

@wsargent
Copy link
Collaborator

wsargent commented Jun 23, 2020

  • Wrap blindsight loggers with a feature flag solution that lets you turn logging on and off at runtime.
  • Use conditional logging with tracer bullet logging.
  • Write diagnostic logs out to /tmpfs, using a rolling file appender. On exception, you can take a snapshot of the debug/trace logs.
  • If you write debug and trace logging, keep it and make it useful for production.
  • Do not include sensitive data in your logs.
  • Consider putting a logging schema together.
  • Use terse-logback for the appenders.

Rather than build an in-memory ringbuffer API and have codde for it, may be better to simply use tmpfs and write to a file with rotation.

Especially since debugging/tracing data can be written out continuously via logstash-logback-encoder in a better binary format than raw JSON.

https://github.com/FasterXML/jackson-dataformats-binary#binary-formats-included

tmpfs may use swap space if necessary, so it will respond to memory pressure if the system is under load.

https://unix.stackexchange.com/questions/424341/mount-var-logs-as-tmpfs-with-help-of-overlayfs-to-save-changes-sometimes/424510#424510

https://blog.dustinkirkland.com/2016/01/data-driven-analysis-tmp-on-tmpfs.html

Using a tmpfs filesystem sidesteps the problem of having disk IO be the bottleneck, and means that the debug/trace data is available across process, while also being ephemeral. If there's an exception, look at those files.

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