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

Create the easeprobe.pid file & Accept HUP Signal to Rotate Log #75

Merged
merged 16 commits into from
May 13, 2022

Conversation

haoel
Copy link
Contributor

@haoel haoel commented May 11, 2022

two major features:

  • pid file: we can configure the PID file in settings, and if configured to empty "", it would be disabled.

    • If the file already exists, EaseProbe would overwrite it.
    • If the file cannot be written, EaseProbe would exit with an error.
    • If want disables the PID file, you can configure the pid file to "".
  • HUP signal handling: rotate the access log of the application log once receive the HUP signal.

     log:
       file: /path/to/log/file
       self_rotate: true # default: true

    If self_rotate is true, EaseProbe would rotate the log automatically, and the following options are available:

      size: 10 # max size of log file. default: 10M
      age: 7 # max age days of log file. default: 7 days
      backups: 5 # max backup log files. default: 5
      compress: true # compress. default: true

    If self_rotate is false, EaseProbe would not rotate the log, and the log file would be rotated by the 3rd-party tool. e.g. logrotate.

@haoel haoel requested a review from zhao-kun May 11, 2022 06:52
cmd/easeprobe/main.go Outdated Show resolved Hide resolved
@haoel haoel changed the title Create the easeprobe.pid file when EaseProbe start Create the easeprobe.pid file & Accept HUP Signal to Rotate Log May 11, 2022
README.md Outdated Show resolved Hide resolved
daemon/daemon_linux.go Show resolved Hide resolved
daemon/daemon.go Outdated Show resolved Hide resolved
@haoel
Copy link
Contributor Author

haoel commented May 12, 2022

@proditis @zhao-kun I've updated this PR's description (at the beginning), please help to review it. Thanks in advance!

conf/log.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@proditis proditis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me (up to the point I can understand).

Great work everyone 👏

cmd/easeprobe/main.go Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
cmd/easeprobe/main.go Outdated Show resolved Hide resolved
daemon/daemon_darwin.go Show resolved Hide resolved
haoel and others added 2 commits May 12, 2022 17:56
Co-authored-by: Pantelis Roditis <[email protected]>
Co-authored-by: Pantelis Roditis <[email protected]>
Copy link
Collaborator

@proditis proditis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

README.md Outdated Show resolved Hide resolved
Co-authored-by: Pantelis Roditis <[email protected]>
Copy link
Collaborator

@proditis proditis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@zhao-kun zhao-kun merged commit 74cd6ec into megaease:main May 13, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants