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

appender: add a builder for constructing RollingFileAppenders #2227

Merged
merged 6 commits into from
Jul 18, 2022

Commits on Jul 18, 2022

  1. appender: add a builder for constructing RollingFileAppenders

    Several currently open PRs, such as #2225 and #2221, add new
    configuration parameters to the rolling file appender in
    `tracing-appender`. The best way to add new optional configuration
    settings without breaking existing APIs or creating a very large number
    of new constructors is to add a builder interface.
    
    Since a number of PRs would all need to add the builder API, introducing
    potential conflicts, this branch _just_ adds the builder interface
    without adding any new configuration options. Once this merges, the
    existing in-flight PRs can be rebased onto this branch to use the
    builder interface without conflicting with each other.
    
    Also, the `Builder::build` method is fallible and returns a `Result`,
    rather than panicking. This is a relatively common pattern in Rust ---
    for example, `std::thread::Builder::spawn` returns a `Result` if a new
    thread cannot be spawned, while `std::thread::spawn` simply panics. This
    allows users to handle appender initialization errors gracefully without
    breaking the API of the existing `new` constructor.
    
    Fixes #1953
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    c5af7cc View commit details
    Browse the repository at this point in the history
  2. fix docs link

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    1293bc1 View commit details
    Browse the repository at this point in the history
  3. only use date for NEVER rotation if there's no pfx

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    a9bab79 View commit details
    Browse the repository at this point in the history
  4. fix wrong method name in examples

    lol. lmao.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    0fd4032 View commit details
    Browse the repository at this point in the history
  5. don't try to write to /var/log in doctests

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    5c21389 View commit details
    Browse the repository at this point in the history
  6. agh i missed one

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    24a4ee9 View commit details
    Browse the repository at this point in the history