Skip to content

Conversation

@lvkv
Copy link

@lvkv lvkv commented Dec 25, 2025

Closes #3270 by introducing a RollingFileAppender builder method to create a symbolic link to the latest log file.

Motivation

From the issue (#3270):

It has always been a bit annoying to find the latest log file in a large directory instead of just jumping to a "latest log" symlink.
And as @clia mentioned in #1979, it's also useful to be able to tail -F the symlink for peace of mind.

Solution

I've added a RollingFileAppender builder method to create a symbolic link to the latest log file. The method takes as input the desired name of the symlink, and the link is updated whenever the appender rotates log files.

I've also written an integration test for this.

Dependencies

This introduces a dependency on symlink for cross-platform symbolic link management. symlink itself has zero dependencies and hasn't changed in years. That being said, it's understandable if you're hesitant to introduce a new dependency. The other most compelling options are:

  • Recreate the functionality of symlink within tracing-appender to avoid the dep altogether
  • Create a Cargo feature for this and make symlink an optional dependency
    • If you'd like to go down this route, how far would you like to go? [cfg(...)] gate all over the place?

Tyty

Thanks for taking time to read and review this PR. I'm more than happy to work with you and add/change/remove/discuss whatever needs to be added/changed/removed/discussed to get this merged.

@lvkv lvkv requested review from a team, hawkw and hds as code owners December 25, 2025 04:39
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.

Feature: symlink to the latest log file

1 participant