Repository navigation
Conversation
…gs on uninstall The daily maintenance now also removes the log entries older than the configured number of days (default 28) from the log file and its previous generation, independent of the log level. The size limit at which the log is rotated is configurable (default 5 MB, as before). The log files are deleted when the plugin is uninstalled. Fixes #185 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017uE6PYkghPiTJRGH1QrWZx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #185.
Problem
The "Prune old attempts" setting only deletes database rows. The log file (
plg_system_bfstop.log.php) was only rotated by size (5 MB, one previous generation), so entries could stay forever on quiet sites, and the log files stayed behind after logging was disabled or the plugin uninstalled.Changes
LoggerHelper::pruneByAge($days): removes entries older than the retention from the log file and its previous generation, rewriting in place under a lock. Lines that don't start with a timestamp (header, multi-line messages) are kept or dropped with the entry before them. Runs from the daily maintenance, independent of the log level.logMaxSize(MB, default 5, as before) andlogKeepDays(default 28, 0 = keep until rotated). The settings form fields are in the companion com_bfstop PR.LoggerHelperTest; CHANGELOG entry.Needs the companion PR in com_bfstop (settings + prune/clear buttons in the log view): https://github.com/codeling/com_bfstop/pulls
Testing
Integration tests need a Joomla site and could not be run in my environment; the pruning/rotation logic was checked with a standalone script against stubbed Joomla classes. CI runs the integration tests.
🤖 Generated with Claude Code
https://claude.ai/code/session_017uE6PYkghPiTJRGH1QrWZx
Generated by Claude Code