diff options
author | Vitaly Takmazov | 2016-06-24 15:18:24 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-06-24 15:18:24 +0300 |
commit | 2f5b0da83de728d7ba1b35b3528055462002de8a (patch) | |
tree | 57758da94b6eb8db7fbdcb474c5ed0e3c2dbc4f9 /src/main/java/com/juick/jabber/ws/Main.java | |
parent | 095dee1388919eac7d3a3fa6fc93767f82c16365 (diff) |
logging
Diffstat (limited to 'src/main/java/com/juick/jabber/ws/Main.java')
-rw-r--r-- | src/main/java/com/juick/jabber/ws/Main.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/juick/jabber/ws/Main.java b/src/main/java/com/juick/jabber/ws/Main.java index 3a26c3ad..6f5ed96a 100644 --- a/src/main/java/com/juick/jabber/ws/Main.java +++ b/src/main/java/com/juick/jabber/ws/Main.java @@ -21,10 +21,11 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.datasource.DriverManagerDataSource; import java.io.FileInputStream; -import java.sql.DriverManager; -import java.sql.SQLException; import java.util.ArrayList; import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; /** * @@ -32,6 +33,8 @@ import java.util.Properties; */ public class Main { + private static final Logger logger = Logger.getLogger("Websockets"); + JdbcTemplate sql; XMPPConnection xmpp; public static String STATSFILE = null; @@ -43,6 +46,7 @@ public class Main { public void start() { try { + LogManager.getLogManager().readConfiguration(new FileInputStream("/etc/juick/ws_logging.properties")); Properties conf = new Properties(); conf.load(new FileInputStream("/etc/juick/ws.conf")); @@ -56,7 +60,7 @@ public class Main { new Thread(new WSData(sql)).start(); new Thread(new WSKeepAlive(sql)).start(); } catch (Exception e) { - System.err.println(e); + logger.log(Level.SEVERE, "websockets initialization error", e); } } |