Summary of changes
Config (src/main/resources/config.yml)
- Added a full, toggle-driven configuration:
- Global enable switch and per-target toggles (targets.jul, targets.bukkit, targets.log4j).
- Filter defaults: enableLevelSuppression, levelThreshold, suppressPatterns, allowOnlyPatterns, deduplication, rateLimit, burst (adaptive suppression).
- Per-source rules scaffold: rules.sources set to an empty list with commented examples to avoid duplicate placeholders.
- Simulate mode, quarantine buffer, and metrics digest sections (with sensible defaults and comments).
- Generic webhooks: webhooks.enabled and webhooks.endpoints set to an empty list (comments show how to add entries, no duplicates by default).
- Discord webhook section: discord.enabled, discord.url, discord.username, discord.avatarUrl, discord.mention.everyone, discord.mention.roles.
- Cleaned “duplicate-prone” placeholders:
- Replaced embedded list samples with commented examples.
- Ensured rules.sources: [] and webhooks.endpoints: [] start empty to avoid accidental duplicates.
Java: LogSuppressingFilter (src/main/java/.../LogSuppressingFilter.java)
- Replaced the simple level-only filter with a configurable filter supporting:
- Level threshold suppression.
- Regex-based suppression and allow-only lists.
- Deduplication time window.
- Simple per-key rate limiting.
- Public API preserved via Filter interface; constructed via parameters from plugin config.
Java: RMConsoleSpam (src/main/java/.../RMConsoleSpam.java)
- Configuration loading:
- Loads all primary toggles and filter settings from config (enabled, targets., filter. including dedup and rate limit).
- Parses the new Discord webhook configuration inside loadConfiguration (discord.*).
- Logger wiring and lifecycle:
- Builds LogSuppressingFilter from config and applies it to JUL root logger, handlers, and Bukkit logger.
- Log4j integration uses reflective ThresholdFilter honoring the configured threshold.
- Restores original filters on disable.
- Commands:
- Supports toggle/on/off and reload (reloadConfigAndApply).
- Discord webhook integration adjustments:
- Declared class fields for Discord config (discordEnabled, discordUrl, discordUsername, discordAvatarUrl, discordMentionEveryone, discordMentionRoles).
- Fixed compile issue by removing a misplaced Discord parsing block from onDisable and moving parsing into loadConfiguration where cfg exists.
- Add a config.yml with toggles and sensible defaults for features and targets (JUL, Bukkit, Log4j).
- Replace LogSuppressingFilter with a configurable filter supporting level threshold, regex suppression, allow-list, deduplication, and rate limiting.
- Update RMConsoleSpam to load config on enable, build the filter from config, and apply suppression selectively to JUL/Bukkit/Log4j based on config.
- Add a reload subcommand to refresh configuration at runtime and re-apply filters.
- Ensure Log4j reflection uses configured threshold and only installs when enabled.
