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/WSKeepAlive.java | |
parent | 095dee1388919eac7d3a3fa6fc93767f82c16365 (diff) |
logging
Diffstat (limited to 'src/main/java/com/juick/jabber/ws/WSKeepAlive.java')
-rw-r--r-- | src/main/java/com/juick/jabber/ws/WSKeepAlive.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/jabber/ws/WSKeepAlive.java b/src/main/java/com/juick/jabber/ws/WSKeepAlive.java index f253439d..6244013d 100644 --- a/src/main/java/com/juick/jabber/ws/WSKeepAlive.java +++ b/src/main/java/com/juick/jabber/ws/WSKeepAlive.java @@ -5,12 +5,15 @@ import org.springframework.jdbc.core.JdbcTemplate; import java.io.PrintWriter; import java.nio.ByteBuffer; import java.util.Iterator; +import java.util.logging.Level; +import java.util.logging.Logger; /** * * @author ugnich */ public class WSKeepAlive implements Runnable { + private static final Logger logger = Logger.getLogger(WSKeepAlive.class.getName()); JdbcTemplate sql; ByteBuffer pingBytes; @@ -44,7 +47,7 @@ public class WSKeepAlive implements Runnable { statsFile = new PrintWriter(Main.STATSFILE, "UTF-8"); } catch (Exception e) { statsFile = null; - System.err.println("WSKeepAlive statsFile: " + e); + logger.severe("WSKeepAlive statsFile: " + e); } } @@ -69,7 +72,7 @@ public class WSKeepAlive implements Runnable { statsFile.print("<td>" + (s.allMessages ? "+" : "") + "</td>"); statsFile.print("<td>" + (s.allReplies ? "+" : "") + "</td></tr>"); } catch (Exception e) { - System.err.println("WSKeepAlive statsFile print: " + e); + logger.log(Level.SEVERE, "WSKeepAlive statsFile print", e); } } @@ -90,7 +93,7 @@ public class WSKeepAlive implements Runnable { statsFile.write("</table></body></html>"); statsFile.close(); } catch (Exception e) { - System.err.println("WSKeepAlive statsFile close: " + e); + logger.log(Level.SEVERE, "WSKeepAlive statsFile close", e); } } |