summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ConsoleLogManager.java
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/net/minecraft/server/ConsoleLogManager.java
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/net/minecraft/server/ConsoleLogManager.java')
-rw-r--r--src/main/java/net/minecraft/server/ConsoleLogManager.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/ConsoleLogManager.java b/src/main/java/net/minecraft/server/ConsoleLogManager.java
index eae9dab0..806df662 100644
--- a/src/main/java/net/minecraft/server/ConsoleLogManager.java
+++ b/src/main/java/net/minecraft/server/ConsoleLogManager.java
@@ -37,7 +37,13 @@ public class ConsoleLogManager {
a.addHandler(consolehandler);
try {
- FileHandler filehandler = new FileHandler("server.log", true);
+ // CraftBukkit start
+ String pattern = (String)server.options.valueOf("log-pattern");
+ int limit = ((Integer)server.options.valueOf("log-limit")).intValue();
+ int count = ((Integer)server.options.valueOf("log-count")).intValue();
+ boolean append = ((Boolean)server.options.valueOf("log-append")).booleanValue();
+ FileHandler filehandler = new FileHandler(pattern, limit, count, append);
+ // CraftBukkit start
filehandler.setFormatter(consolelogformatter);
a.addHandler(filehandler);