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

chore: add rotating log for audit data #473

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

DmitriyMV
Copy link
Member

Adds rotating audit log writer. Also minor improvements.

For #37

@DmitriyMV DmitriyMV force-pushed the audit-rotation branch 4 times, most recently from cc63bb0 to b7ee728 Compare July 22, 2024 13:47
@DmitriyMV
Copy link
Member Author

So on further thinking I reworked writeAt (now dumpAt because of the similarity to spew.Dump and other pretty printers/dumpers) to take the lock right after we are finished with encoding. I looked at other solutions (such as creating locked wrapper around the file and implement synced WriteTo), but overall I don't think it worth it. I also moved the time assertion inside the locked part, so now all writers are fully ordered.

@DmitriyMV
Copy link
Member Author

@smira I also added TestLogFile_CurrentDayConcurrent test to be sure.

Adds rotating audit log writer. Also minor improvements.

For siderolabs#37

Signed-off-by: Dmitriy Matrenichev <[email protected]>
@DmitriyMV
Copy link
Member Author

/m

@talos-bot talos-bot merged commit 5dd5259 into siderolabs:main Jul 25, 2024
18 checks passed
@DmitriyMV DmitriyMV deleted the audit-rotation branch July 25, 2024 17:10
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.

4 participants