Enhance Bukkit.dispatchCommand for improved logging and plugin accountability. #11584
GeorgeV220
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
In many server environments, plugins frequently dispatch commands, either directly or as part of automated tasks. However, without a clear log of these actions, it can be challenging to identify which commands are run, by whom, and when. This lack of transparency complicates debugging and can make it difficult to pinpoint the origin of specific commands, especially when issues arise from unexpected behavior or interactions between plugins.
Additionally, the current
dispatchCommand(String)
method does not specify which plugin triggered the command, limiting traceability. By logging command executions along with aPlugin
parameter, administrators and developers can:Ultimately, this feature aims to strengthen accountability and make it easier to manage complex server environments where multiple plugins interact.
Describe the solution you'd like.
The solution involves enhancing the
Bukkit.dispatchCommand
method in two key ways to improve logging and traceability:Add Command Execution Logging:
Bukkit.dispatchCommand
that records each command executed, including:Introduce New Method Signature for Better Plugin Identification:
dispatchCommand
:plugin
parameter explicitly identifies the plugin initiating the command dispatch. This addition enhances traceability by attributing each command to its source plugin.dispatchCommand(String)
Method: Mark the original method as deprecated to guide developers towards the new API that includes plugin attribution. This transition would encourage consistent usage of the updated API, reinforcing traceability practices.Expected Benefits:
By adding logging and introducing a more informative method signature, this solution aims to improve the management and oversight of command dispatching within the PaperMC environment.
Describe alternatives you've considered.
Custom Logging within Plugins:
External Command Monitoring Plugins:
Why the Proposed Solution is Preferred:
The proposed solution—adding direct logging to
Bukkit.dispatchCommand
and introducing a method that requires specifying the plugin source—addresses the key challenges of command traceability and accountability while maintaining consistency across all plugins. This approach ensures that logging is comprehensive, integrated, and available to server administrators without relying on additional plugins or configurations.Other
Beta Was this translation helpful? Give feedback.
All reactions