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

Enable system.log.rotate_... system configuration #3352

Merged
merged 4 commits into from
May 13, 2021

Commits on May 13, 2021

  1. Enable system.log.rotate_... system configuration

    In the previous versions, log rotation options were supported as
    --log-rotate-age or --log-rotate-size via command line options.
    
    On Windows, as fluentd is launched as a windows service, it is
    required to configure again via --reg-winsvc-fluentdopt or edit
    fluentdopt registry key for customization.
    
    This approach is not convenient for Windows users, so it may be better
    to support more comprehensive solution - customize via configuration
    file.
    
    This commit introduces such a configurable parameter in .conf
    
      <system>
       <log>
         rotate_age 5
         rotate_size 1048576
       </log>
      </system>
    
    Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
    kenhys committed May 13, 2021
    Configuration menu
    Copy the full SHA
    b89c9f6 View commit details
    Browse the repository at this point in the history
  2. test: add rotation system config test case

    Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
    kenhys committed May 13, 2021
    Configuration menu
    Copy the full SHA
    01648de View commit details
    Browse the repository at this point in the history
  3. test: declare that test case use v0.10 explicitly

    In the previous versions, Fluent::Supervisor.new(opts) doesn't parse
    content actually at that time, so it doesn't care whether v0 or v1
    parser is used.
    
    But, by introducing support for log rotation configuration, it was
    changed to fetch rotate_age and rotate_size in early stage because
    these parameters must be passed to LogInitializer during
    initialization steps, so configuration file is changed to parse in
    Fluent::Supervisor.new(opts).
    
    As a result, we need to pass additional parameter for this test case.
    Without this fix, log rotate configuration in <system> support raises
    the following exception:
    
      Failure: test_inline(ConfigTest):
        Exception raised:
        Fluent::ConfigParseError(<expected end tag '</include>' but got end of file at config_test_1.conf line 11,10
         10:   port 2222
         11:  </source>
             ----------^
        >)
    
    Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
    kenhys committed May 13, 2021
    Configuration menu
    Copy the full SHA
    9a10164 View commit details
    Browse the repository at this point in the history
  4. unify Fluent::Log::LOG_ROTATE_AGE for consistency

    Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
    kenhys committed May 13, 2021
    Configuration menu
    Copy the full SHA
    627c841 View commit details
    Browse the repository at this point in the history