Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Change the default log config to reduce disk I/O and storage #8040

Merged
merged 11 commits into from
Aug 11, 2020

Commits on Aug 6, 2020

  1. Change default log config to buffer by default.

    This batches up writes to the filesystem, which is more efficient for
    disk I/O. This means that it can take some time for logs to get written
    to disk. Note that ERROR logs (and above) immediately flush the buffer.
    
    This only effects new installs, as we only write the log config if
    started with `--generate-config` (in the same way we do for generating
    signing keys).
    erikjohnston committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    1af663d View commit details
    Browse the repository at this point in the history
  2. Default to keeping last 4 days of logs.

    This hopefully reduces the amount of logs kept for new servers. Keeping
    the last 1GB of logs is likely overkill for new servers, but equally may
    not be enough for busy ones.
    
    Instead, we keep the last four days worth of logs, enough so that admins
    can investigate any problems that happened over e.g. a long weekend.
    erikjohnston committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    29b921e View commit details
    Browse the repository at this point in the history
  3. Newsfile

    erikjohnston committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    ed8a183 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    07465f0 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2020

  1. Review comments

    erikjohnston committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    5936b1a View commit details
    Browse the repository at this point in the history
  2. Move setting of Filter into code.

    We do this to prevent foot guns. The default config uses a MemoryFilter,
    but users are free to change to logging to files directly. If they do
    then they have to ensure to set the `filters: [context]` on the right
    handler, otherwise records get written with the wrong context.
    
    Instead we move the logic to happen when we generate a record, which is
    when we *log* rather than *handle*.
    
    (It's possible to add filters to loggers in the config, however they
    don't apply to descendant loggers and so they have to be manually set on
    *every* logger used in the code base)
    erikjohnston committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    c2fc81e View commit details
    Browse the repository at this point in the history
  3. Flush at WARNING logs as well

    We don't WARN too frequently, so this is fine and ensures that we log
    things like "STARTING" immediately.
    erikjohnston committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    5590a73 View commit details
    Browse the repository at this point in the history
  4. Revert "Move setting of Filter into code."

    This reverts commit c2fc81e.
    erikjohnston committed Aug 7, 2020
    Configuration menu
    Copy the full SHA
    dd0b6f2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e7d2a9e View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2020

  1. Document console handler

    erikjohnston committed Aug 10, 2020
    Configuration menu
    Copy the full SHA
    62289fa View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2020

  1. Configuration menu
    Copy the full SHA
    538efd0 View commit details
    Browse the repository at this point in the history