mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
Fixes #27
This commit is contained in:
parent
8d961ce572
commit
a7d1a00ae8
@ -9,9 +9,9 @@ import java.net.InetSocketAddress;
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
LogManager.initialize();
|
||||
ServerConfiguration config = new ServerConfiguration("config.properties");
|
||||
LogManager.initialize(config);
|
||||
|
||||
//Load
|
||||
GameServer.INSTANCE.load();
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.simon987.server.logging;
|
||||
|
||||
import net.simon987.server.ServerConfiguration;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.logging.*;
|
||||
|
||||
@ -16,7 +18,7 @@ public class LogManager {
|
||||
/**
|
||||
* Initialises the logger
|
||||
*/
|
||||
public static void initialize() {
|
||||
public static void initialize(ServerConfiguration config) {
|
||||
LOGGER.setUseParentHandlers(false);
|
||||
|
||||
/*
|
||||
@ -45,15 +47,18 @@ public class LogManager {
|
||||
handler.setLevel(Level.ALL);
|
||||
|
||||
try {
|
||||
Handler fileHandler = new FileHandler("mar.log");
|
||||
Handler fileHandler = new FileHandler("mar-%g.log", config.getInt("log_limit"),
|
||||
config.getInt("log_count"));
|
||||
fileHandler.setLevel(Level.ALL);
|
||||
fileHandler.setFormatter(new GenericFormatter());
|
||||
|
||||
|
||||
LOGGER.addHandler(handler);
|
||||
LOGGER.addHandler(errHandler);
|
||||
LOGGER.addHandler(fileHandler);
|
||||
LOGGER.setLevel(Level.ALL);
|
||||
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ mysql_pass=mar
|
||||
mysql_url=jdbc:mysql://localhost:3306/mar?useSSL=false
|
||||
# File management
|
||||
save_interval=5
|
||||
clean_interval=10
|
||||
history_size=10
|
||||
log_limit=2000000
|
||||
log_count=10
|
||||
# Web server port
|
||||
webSocket_port=8887
|
||||
webSocket_host=0.0.0.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user