Add log rotation to server & UI improvements #157
No reviewers
Labels
No labels
bug
dependencies
docker
documentation
duplicate
enhancement
good first issue
help wanted
invalid
javascript
question
rust
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: andras/vault-link#157
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "asch/logs"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull Request Overview
This PR adds log rotation functionality to the server and includes several UI improvements. The main additions include a new
RotatingFileWritermodule that handles time-based log file rotation, configuration options for logging, and frontend enhancements for better timestamp handling and UI rendering.Key Changes
RotatingFileWriterfor time-based log file rotation with support for configurable rotation intervalsLoggingConfig) to allow customization of log directory and rotation durationReviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -4,6 +4,7 @@background-color: var(--color-base-00);Inconsistent indentation: this line uses spaces while the rest of the file uses tabs. Change to tab indentation to match the file's style.
@ -13,1 +13,4 @@pub const DEFAULT_MAX_CLIENTS_PER_VAULT: usize = 256;pub const DEFAULT_LOG_DIRECTORY: &str = "logs";pub const DEFAULT_LOG_ROTATION_INTERVAL: Duration = Duration::from_secs(60 * 60 * 24); // 1 dayThe Duration import is missing from this file. Add
use std::time::Duration;at the top of the file to make this constant compile.@ -0,0 +84,4 @@) -> SystemTime {Self::find_latest_log_file(directory, file_prefix).and_then(|filename| Self::parse_log_timestamp(&filename, file_prefix)).map_or_else(SystemTime::now, |last_rotation| {The
calculate_next_rotation_timefunction always returns the current time when no log files exist, but the function should return the next rotation time (current time + rotation_duration) to be consistent with its name and behavior. When a writer is created for the first time, the next rotation should be scheduled for rotation_duration in the future, not immediately.