aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/NewMessage.java
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-10 04:50:07 +0700
committerGravatar Vitaly Takmazov2016-11-10 21:41:14 +0300
commit09221ab5695e99b2df1130ea923c39625ec85429 (patch)
tree58c775188d25239a1e32a83f8007e5f1679d49ee /juick-www/src/main/java/com/juick/www/NewMessage.java
parent705d4f87c97dfa20eb6daa88b93ff124fa401b92 (diff)
using slf4j + logback for logging
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/NewMessage.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/NewMessage.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/juick-www/src/main/java/com/juick/www/NewMessage.java b/juick-www/src/main/java/com/juick/www/NewMessage.java
index d45f1a4b..aaa3e550 100644
--- a/juick-www/src/main/java/com/juick/www/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/NewMessage.java
@@ -29,6 +29,8 @@ import com.juick.xmpp.extensions.XOOB;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.math.NumberUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.ServletException;
@@ -44,8 +46,6 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
*
@@ -53,7 +53,7 @@ import java.util.logging.Logger;
*/
public class NewMessage {
- private static final Logger logger = Logger.getLogger(NewMessage.class.getName());
+ private static final Logger logger = LoggerFactory.getLogger(NewMessage.class);
private String tmpDir, imgDir;
@@ -179,7 +179,7 @@ public class NewMessage {
try {
attachmentFName = Utils.receiveMultiPartFile(request, "attach");
} catch (Exception e) {
- logger.log(Level.SEVERE, "MULTIPART ERROR", e);
+ logger.error("MULTIPART ERROR", e);
response.sendError(400);
return;
}
@@ -190,7 +190,7 @@ public class NewMessage {
URL imgUrl = new URL(paramImg);
attachmentFName = Utils.downloadImage(imgUrl);
} catch (Exception e) {
- logger.log(Level.SEVERE, "DOWNLOAD ERROR", e);
+ logger.error("DOWNLOAD ERROR", e);
response.sendError(500);
return;
}
@@ -257,7 +257,7 @@ public class NewMessage {
xmsg.to.Username = "jubo";
xmpp.send(xmsg);
} else {
- logger.log(Level.WARNING, "XMPP unavailable");
+ logger.warn("XMPP unavailable");
}
//
@@ -346,7 +346,7 @@ public class NewMessage {
try {
attachmentFName = Utils.receiveMultiPartFile(request, "attach");
} catch (Exception e) {
- logger.log(Level.SEVERE, "MULTIPART ERROR", e);
+ logger.error("MULTIPART ERROR", e);
response.sendError(400);
return;
}
@@ -356,7 +356,7 @@ public class NewMessage {
try {
attachmentFName = Utils.downloadImage(new URL(paramImg));
} catch (Exception e) {
- logger.log(Level.SEVERE, "DOWNLOAD ERROR", e);
+ logger.error("DOWNLOAD ERROR", e);
response.sendError(500);
return;
}
@@ -415,7 +415,7 @@ public class NewMessage {
xmsg.to.Host = "push.juick.com";
xmpp.send(xmsg);
} else {
- logger.log(Level.WARNING, "XMPP unavailable");
+ logger.warn("XMPP unavailable");
}
Utils.sendTemporaryRedirect(response, "/" + msg.getUser().getUName() + "/" + mid + "#" + ridnew);
@@ -450,7 +450,7 @@ public class NewMessage {
xmsg.addChild(jmsg);
xmpp.send(xmsg);
} else {
- logger.log(Level.WARNING, "XMPP unavailable");
+ logger.warn("XMPP unavailable");
}
Utils.replyJSON(request, response, "{\"status\":\"ok\"}");