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

Feature develop: add time-based log rotation to logger module #20

Open
sunist-c opened this issue Jul 1, 2024 · 0 comments
Open

Feature develop: add time-based log rotation to logger module #20

sunist-c opened this issue Jul 1, 2024 · 0 comments
Assignees
Milestone

Comments

@sunist-c
Copy link
Contributor

sunist-c commented Jul 1, 2024

Add Time-based Log Rotation to Logger Module

Reference: logger module

Summary

Enhance the existing logger module in the alioth-center/infrastructure repository by adding a feature to rotate logs based on time intervals. This feature should include asynchronous file writing to prevent blocking and ensure that all pending log entries are written to files upon exit.

Function Expected

  • Implement time-based log rotation.
  • Ensure asynchronous writing of logs to files to avoid blocking the main application.
  • Register an exit handler to flush all pending log entries to files upon application exit.

Details of Implementation

  1. Time-based Log Rotation

    • Develop a mechanism to rotate log files based on predefined time intervals (e.g., hourly, daily).
    • Ensure that new log files are created automatically after each interval.
  2. Asynchronous File Writing

    • Implement asynchronous file writing to ensure that the logging process does not block the main application.
    • Use appropriate asynchronous I/O libraries or techniques to achieve non-blocking behavior.
  3. Exit Handler Registration

    • Register an exit handler that ensures all pending log entries are written to the log files before the application exits.
    • Handle various exit scenarios (e.g., normal shutdown, exceptions) to ensure no log entries are lost.
@sunist-c sunist-c self-assigned this Jul 1, 2024
@sunist-c sunist-c added this to the v1.3 milestone Jul 1, 2024
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

No branches or pull requests

1 participant