+
Skip to content

Conversation

thomastaylor312
Copy link

@thomastaylor312 thomastaylor312 commented Jun 5, 2025

This uses tracing appender and combines with the default stdout writer that comes from fmt::layer.

Closes #87

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

This uses tracing appender and combines with the default stdout writer
that comes from `fmt::layer`.

Signed-off-by: Taylor Thomas <taylor@oftaylor.com>
tokio::fs::create_dir_all(&log_dir)
.await
.wrap_err("could not create log directory")?;
let appender = RollingFileAppender::builder()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed like a decent idea so the log wouldn't grow forever, but we can also just do a plain file as well

let appender = RollingFileAppender::builder()
.filename_prefix("atuin.log")
.rotation(Rotation::DAILY)
.max_log_files(7)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably make this configurable if we want to keep the rotating appender around. If we do, should this just be an env var or also exposed in settings?

Copy link
Author

@thomastaylor312 thomastaylor312 Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an env var for now just in case. Easy enough to pop off or modify depending on feedback!

@thomastaylor312
Copy link
Author

thomastaylor312 commented Jun 5, 2025

In draft so I can get some feedback on the comments above. If there was a different idea in mind, please let me know. This wasn't too difficult so easy enough to throw away and take another approach

This configures the total number of days of logs that should be kept

Signed-off-by: Taylor Thomas <taylor@oftaylor.com>
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.

Log to file

1 participant

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载