summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorstevenh <steven.hartland@multiplay.co.uk>2011-07-10 18:28:57 +0100
committerstevenh <steven.hartland@multiplay.co.uk>2011-07-10 18:28:57 +0100
commit83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56 (patch)
tree7a36b5600059f2aacb7150bed4827e222e42de5f /src/main/java/org
parentf6a06e8df4b5205dd8085d4f7f32f73b12257939 (diff)
downloadcraftbukkit-83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56.tar
craftbukkit-83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56.tar.gz
craftbukkit-83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56.tar.lz
craftbukkit-83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56.tar.xz
craftbukkit-83fd8fad6997bd438e0a2f8d1bccfd6d9c1cbd56.zip
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
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/Main.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 3ec19b46..4beb5b77 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -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");