-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update logging code. #7314
Update logging code. #7314
Conversation
This looks pretty good so far, I have a couple of small complaints though: Currently the debug.log has a very long-winded prefix to it, and I'm not certain how useful it would ever be:
Can it be reduced to not carry the class and line number its called from? The second thing I've spotted is in relation to the backups made at the startup and the logs which are backed up. Currently when Towny loads we make a backup zip/tar that includes the log files. We also make a backup at the end of each towny-new-day. The loggers are starting up and appear to be wiping any existing log file, so that when the backup is made on startup, its backing up an empty log, or in the case of the towny.log the towny startup sequence. All of the logging in between the last towny-new-day and new startup is lost. Also it is probably best we set our pom.xml to use the latest and greatest log4j version instead of showing an older version. |
In the latest commit I have removed the Class, Method and Line number. The loggers only wipe any existing log file as according to the Config setting: PLUGIN_RESET_LOG_ON_BOOT. And the log4j version is older on purpose as it is matched to the log4j2 version included in Minecraft 1.16.5 (our oldest supported version). |
This PR needs a rebase. |
# Conflicts: # Towny/src/main/java/com/palmergames/bukkit/towny/db/TownyFlatFileSource.java
Done. |
- Drops the usage of deprecated methods and begins using the towny.log file again. - Closes #5855.
Description:
Update the Logging to Log4J 2.19.0 (which is included in the spigot jar) and does not use deprecated methods anymore.
Switches the TownyLogger to a util-class and not a singleton.
Attaches the debug logger to the standard towny logger and logs all debug messages to debug.log
Standard towny logger's info messages now go to towny.log, including those from Towny.getPlugin().getLogger().
New Nodes/Commands/ConfigOptions:
None
Relevant Towny Issue ticket:
At least on my machine this fixed #5855.
By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.