From 09221ab5695e99b2df1130ea923c39625ec85429 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Thu, 10 Nov 2016 04:50:07 +0700 Subject: using slf4j + logback for logging --- .../java/com/juick/components/s2s/ConnectionIn.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java') diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java index 41336582..8cc61e26 100644 --- a/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java +++ b/juick-xmpp/src/main/java/com/juick/components/s2s/ConnectionIn.java @@ -6,6 +6,8 @@ import com.juick.xmpp.JID; import com.juick.xmpp.Message; import com.juick.xmpp.Presence; import com.juick.xmpp.utils.XmlUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xmlpull.v1.XmlPullParser; import javax.net.ssl.SSLException; @@ -17,8 +19,6 @@ import java.net.SocketException; import java.util.ArrayList; import java.util.List; import java.util.UUID; -import java.util.logging.Level; -import java.util.logging.Logger; /** * @@ -26,7 +26,7 @@ import java.util.logging.Logger; */ public class ConnectionIn extends Connection implements Runnable { - private static final Logger LOGGER = Logger.getLogger(ConnectionIn.class.getName()); + private static final Logger LOGGER = LoggerFactory.getLogger(ConnectionIn.class); final public List from = new ArrayList<>(); public long tsRemoteData = 0; @@ -109,7 +109,7 @@ public class ConnectionIn extends Connection implements Runnable { LOGGER.info("STREAM FROM " + vfrom + " " + streamID + " DIALBACK VERIFY VALID"); } else { sendStanza(""); - LOGGER.warning("STREAM FROM " + vfrom + " " + streamID + " DIALBACK VERIFY INVALID"); + LOGGER.warn("STREAM FROM " + vfrom + " " + streamID + " DIALBACK VERIFY INVALID"); } } else if (tag.equals("presence") && checkFromTo(parser)) { Presence p = Presence.parse(parser, null); @@ -145,7 +145,7 @@ public class ConnectionIn extends Connection implements Runnable { LOGGER.info("STREAM " + streamID + " SECURED"); restartParser(); } catch (SSLException sex) { - LOGGER.warning("STREAM " + streamID + " SSL ERROR"); + LOGGER.warn("STREAM " + streamID + " SSL ERROR"); sendStanza(""); xmpp.removeConnectionIn(this); closeConnection(); @@ -156,7 +156,7 @@ public class ConnectionIn extends Connection implements Runnable { LOGGER.info("STREAM " + streamID + ": " + XmlUtils.parseToString(parser, true)); } } - LOGGER.warning("STREAM " + streamID + " FINISHED"); + LOGGER.warn("STREAM " + streamID + " FINISHED"); xmpp.removeConnectionIn(this); closeConnection(); } catch (EOFException | SocketException ex) { @@ -164,9 +164,9 @@ public class ConnectionIn extends Connection implements Runnable { xmpp.removeConnectionIn(this); closeConnection(); } catch (HostUnknownException e) { - LOGGER.warning(e.getMessage()); + LOGGER.warn(e.getMessage()); } catch (Exception e) { - LOGGER.log(Level.WARNING, "STREAM " + streamID + " ERROR", e); + LOGGER.warn("STREAM " + streamID + " ERROR", e); xmpp.removeConnectionIn(this); closeConnection(); } @@ -198,7 +198,7 @@ public class ConnectionIn extends Connection implements Runnable { LOGGER.info("STREAM FROM " + sfrom + " " + streamID + " READY"); } } catch (IOException e) { - LOGGER.warning("STREAM FROM " + sfrom + " " + streamID + " ERROR: " + e.toString()); + LOGGER.warn("STREAM FROM " + sfrom + " " + streamID + " ERROR: " + e.toString()); } } -- cgit v1.2.3