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

[v16] Re-open the log file by filesystem notify #44426

Merged
merged 3 commits into from
Aug 26, 2024

Commits on Jul 18, 2024

  1. Re-open the log file by filesystem notify (#43359)

    * Re-open the log file on OS Signal trigger
    
    This PR implements an handler for the CONT signal.
    The handler will close and re-open the log file.
    If the log destination is not a file, this is a no-op.
    
    Useful for logrotate postrotate hook.
    
    * signal replaced with the fsnotify
    
    * code review changes:
    - refactored to launch watcher with process context
    - make file shared writer as singleton
    - add test for logrotate case
    
    * add locking for write, reopen
    
    * - configuration for log section update
    - test simplification
    
    * code review changes:
    - add closing for file shared writer
    - make runWatcherFunc not exported
    
    * linter fixes
    
    * change default file mode for log file
    simplify setting global watcher
    
    * terminate watcher after override global one
    added test for validating global override
    
    * make log file name static for shared writer
    
    * replace logic to use finalizer instead
    
    * fix possible locking write while reopen is triggered
    
    * wrap internal error, fix incorrect unlock
    
    * drop configuration flag, make watcher always enabled
    
    * tune context passing
    
    ---------
    
    Co-authored-by: Vadym Popov <vadym.popov@goteleport.com>
    marcoandredinis and vapopov committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    2c69670 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

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

Commits on Aug 15, 2024

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