Skip to content

RollingFileAppender Logfile Segmentation Timezone problem #3102

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

Open
kwsc98 opened this issue Oct 11, 2024 · 1 comment · May be fixed by #3105 or #3255
Open

RollingFileAppender Logfile Segmentation Timezone problem #3102

kwsc98 opened this issue Oct 11, 2024 · 1 comment · May be fixed by #3105 or #3255

Comments

@kwsc98
Copy link

kwsc98 commented Oct 11, 2024

RollingFileAppender currently uses UTC, but the entire Log system uses Local Time. Can you add and modify RollingFileAppender to change the time zone

@imgoby
Copy link

imgoby commented Jan 14, 2025

I am using this method, but I am not sure if there are any shortcomings
(1)Cargo.toml

tracing = "0.1.41"
tracing-appender = {path = "tracing-appender",version="0.2.0"}
tracing-subscriber = {version="0.3.19", features=["json", "env-filter", "fmt", "time", "local-time"]}
time = { version = "0.3.37", features = ["macros"] }

(2)Download the trcing source code from directory tracing-appender
put it in the project root dir

(3)changing rolling.rs

OffsetDateTime::now_utc()

to:

OffsetDateTime::now_local().expect("error now_local")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants