Append to log files

Set maximum of 1Gig
This commit is contained in:
unknown 2013-12-15 23:12:30 +01:00
parent 2c14773c9b
commit aa0fd34859
3 changed files with 6 additions and 6 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sat Dec 07 10:40:37 CET 2013
build.number=672
#Sun Dec 15 23:11:53 CET 2013
build.number=674

View File

@ -12,6 +12,7 @@ import java.util.logging.Logger;
public class TFM_LogFile
{
public static final int MAX_LOG_SIZE = 1024 * 1024; // Bytes
private final Logger logger;
private final SimpleDateFormat date;
@ -37,7 +38,7 @@ public class TFM_LogFile
private FileHandler getHandler() throws SecurityException, IOException
{
final FileHandler handler = new FileHandler("server.log");
final FileHandler handler = new FileHandler("server.log", MAX_LOG_SIZE, 1);
handler.setLevel(Level.ALL);
handler.setFormatter(getFormatter());
return handler;
@ -47,8 +48,8 @@ public class TFM_LogFile
{
return new Formatter()
{
@Override // org.bukkit.craftbukkit.util.ShortConsoleFormatter
public String format(LogRecord record)
@Override
public String format(LogRecord record) // org.bukkit.craftbukkit.util.ShortConsoleFormatter
{
StringBuilder builder = new StringBuilder();
Throwable ex = record.getThrown();

View File

@ -10,7 +10,6 @@ import me.StevenLawson.TotalFreedomMod.HTTPD.TFM_HTTPD_Manager;
import me.StevenLawson.TotalFreedomMod.Listener.*;
import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import net.minecraft.util.org.apache.commons.lang3.exception.ExceptionUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.World;