Keep your server console and log file clean.
Updated version of my outdated Plugin BlockConsoleMessages.
Important
Updated to work with CB-1.4.7-R1.0. Might work with lower/higher versions as well but I haven´t tested that.
This is just a quick rework to work with the newest version of CB and it was working in my testing envrionment.
However: Before using it in a productive environment please test this plugin!
Known issues
Sadly there are some drawbacks.
Nowadays each plugin gets it´s dedicated logger developers should use. My plugin sets filters for all plugins that are or get registered in CB.
Now to the problem: Developers are not forced to use the plugins default logger. They can just send their messages to custom created loggers. ConsoleFilter doesn´t know about these loggers and therefore wont filter them.
Theoretically I can get all active loggers and put filters onto them. However this would mean that ALL loggers get filtered, be it from bukkit, a plugin, java, etc. As this is not the way it should be done I wont do it this way.
This means that some console output will not be intercepted by ConsoleFilter and therefore wont get filtered.
Installation
- Copy the JAR file into your plugins-folder.
- Please remove BlockCantKeepUpSpam.jar and BlockConsoleMessages.jar if you're using any of them.
- Start the server. If no config file exists the plugin will create one under "./plugins/ConsoleFilter/".When creating a new config it will add the filter for the "Cant keep up!"-message.
- Stop the server and edit the configuration.
How to use
- Open the configuration file while your server is offline.
- Under "Filters:" add a new line and write the following:
- - FilterName: <FilterName>
Replace <FilterName> with any name you want to give the filter.The whitespace between the minus and FilterName is important.
- Add your filter parameters. Each value needs to be preceeded by TWO whitespaces.Possible values:
- FilterType: Exact|Partial|Regex|Level
- Exact: Filters for the exact string given by ConsoleMessage. Requires option: ConsoleMessage.
- Partial: Searches for the partial string given by ConsoleMessage. Requires option: ConsoleMessage.
- Regex: Applies the regular expression defined in ConsoleMessage. Requires option: ConsoleMessage.If you mess up with these you can easily block all console output. ;-) (It wont harm your server though.)If you're interested in learning RegEx: http://en.wikipedia.org/wiki/Regular_expression
- Level: Filters on logging level basis. (e.g. Info, Warning, Severe, etc.) Requires option: ConsoleLevel.
- ConsoleLevel: [Info|Warning|Severe] Optional. This rule applies only to messages with the appropriate logging level.
- ConsoleMessage: <Message|Regex> Optional. String or regular expression to match. Replace <Message> with the string/regex of your choice.
- LogToFile: [true|false] Optional. When set to true it will log the intercepted message to a seperate log file.
- LogfileSuffix: <SuffixString> Optional. This way you can specify seperate logfiles for different rules. Replace <Suffix>with the suffix you want to give the log file.
- Save your configuration file.
- Start your server and (hopefully) enjoy your cleaned up console & log.
Example for a configuration file
ConfigVersion: 0.5
Filters:
- FilterName: Filter CantKeepUp Messages
FilterType: Exact
ConsoleLevel: Info
ConsoleMessage: Can't keep up! Did the system time change, or is the server overloaded?
- FilterName: Filter all Warnings
FilterType: Level
ConsoleLevel: Warning
LogToFile: true
LogfileSuffix: Warnings
- FilterName: Filter lost connections
FilterType: RegEx
ConsoleMessage: '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}:[0-9]{4,5} lost connection'
LogToFile: true
LogfileSuffix: LostConnections
Download
Download from dev.bukkit.org