Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

tracing-appender: Introduce weekly rotation#3218

Open
NickCaplinger wants to merge3 commits intotokio-rs:master
base:master
Choose a base branch
Loading
fromrenewedvision:ncaplinger/weekly-log-rotation-master

Conversation

NickCaplinger
Copy link

Motivation

While configuring tracing-appender, I wanted to specify a weekly log rotation interval. I was unable to do so, as the largest rotation interval was daily.

Solution

Before my introduction of weekly log rotation, rounding the currentOffsetDateTime was straightforward: we could simply keep the current date and truncate part or all of the time component. However, we cannot simply truncate the time with weekly rotation; the date must now be modified.

To round the date, I take its ordinal (how many days have passed since the start of the year) and round it backwards to the nearest 7 day period. This gives us consistent date-times that only change weekly.

dileping and toluRV reacted with thumbs up emoji
@NickCaplingerNickCaplinger requested a review froma team as acode ownerFebruary 17, 2025 19:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@NickCaplinger

[8]ページ先頭

©2009-2025 Movatter.jp