mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
Added command line logging configuration which enables log file:
* Size limiting (--log-limit <size in bytes>) * Rotation (--log-count <count of files>) * Custom naming (--log-pattern <filename pattern>) * Append (--log-append <true|false>) Note: This is done via command line and not bukkit-settings as that would require lots of refactoring of both core server and CraftBukkit due to the current initialisation ordering and depenencies. All settings default to that of the standard server By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
parent
9e4ad7c436
commit
7a4e513ae4
1 changed files with 25 additions and 1 deletions
|
@ -62,6 +62,30 @@ public class Main {
|
|||
.ofType(SimpleDateFormat.class)
|
||||
.describedAs("Log date format");
|
||||
|
||||
acceptsAll(asList("log-pattern"), "Specfies the log filename pattern")
|
||||
.withRequiredArg()
|
||||
.ofType(String.class)
|
||||
.defaultsTo("server.log")
|
||||
.describedAs("Log filename");
|
||||
|
||||
acceptsAll(asList("log-limit"), "Limits the maximum size of the log file (0 = unlimited)")
|
||||
.withRequiredArg()
|
||||
.ofType(Integer.class)
|
||||
.defaultsTo(0)
|
||||
.describedAs("Max log size");
|
||||
|
||||
acceptsAll(asList("log-count"), "Specified how many log files to cycle through")
|
||||
.withRequiredArg()
|
||||
.ofType(Integer.class)
|
||||
.defaultsTo(1)
|
||||
.describedAs("Log count");
|
||||
|
||||
acceptsAll(asList("log-append"), "Whether to append to the log file")
|
||||
.withRequiredArg()
|
||||
.ofType(Boolean.class)
|
||||
.defaultsTo(true)
|
||||
.describedAs("Log append");
|
||||
|
||||
acceptsAll(asList("b", "bukkit-settings"), "File for bukkit settings")
|
||||
.withRequiredArg()
|
||||
.ofType(File.class)
|
||||
|
@ -89,7 +113,7 @@ public class Main {
|
|||
} else {
|
||||
try {
|
||||
useJline = !"jline.UnsupportedTerminal".equals(System.getProperty("jline.terminal"));
|
||||
|
||||
|
||||
if (options.has("nojline")) {
|
||||
System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
|
||||
System.setProperty("user.language", "en");
|
||||
|
|
Loading…
Reference in a new issue