Skip to content

feat(tracing-appender): add the ability for RollingFileAppender to use the local time#3525

Open
jschillem wants to merge 1 commit into
tokio-rs:mainfrom
jschillem:local-rolling-rotate
Open

feat(tracing-appender): add the ability for RollingFileAppender to use the local time#3525
jschillem wants to merge 1 commit into
tokio-rs:mainfrom
jschillem:local-rolling-rotate

Conversation

@jschillem

Copy link
Copy Markdown

Resolves #3524, allowing the RollingFileAppender timezone to be configurable.

Motivation

There may be use cases (like in the linked issue) where a user would want all of their logs to be framed within their local time zone instead of UTC. Currently, the RollingFileAppender always uses UTC for rolling files.

Solution

  • Added a new local-time feature flag to tracing-appender to match the opt-in format used by tracing-subscriber.
  • Created a new ClockKind enum for configuration.
  • Updated the rolling::Builder with a use_local_time() and use_utc() method (by default it will use UTC formatting).
  • Added 2 feature-gated unit tests for ensuring correct rolling behavior when using ClockKind::Local.

This feature has no breaking changes and is strictly opt-in due to ClockKind implementing UTC as its default variant.

@jschillem jschillem requested review from a team, hawkw and hds as code owners April 24, 2026 15:42
@jschillem jschillem force-pushed the local-rolling-rotate branch from b30dfb8 to 2c01e1b Compare May 14, 2026 14:53
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.

tracing_appender rotation Rotation::DAILY UTC not LocalTime

1 participant