From 6cd25ea0a9a8ced38fcc369f74fed087de8e2476 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 27 Jul 2016 16:46:30 +0000 Subject: [PATCH] added liferay logger so that we can change log level at runtime git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/social-mail-servlet@130859 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../org/gcube/portal/socialmail/PeriodicTask.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portal/socialmail/PeriodicTask.java b/src/main/java/org/gcube/portal/socialmail/PeriodicTask.java index a1f8c0e..c69b7f1 100644 --- a/src/main/java/org/gcube/portal/socialmail/PeriodicTask.java +++ b/src/main/java/org/gcube/portal/socialmail/PeriodicTask.java @@ -57,9 +57,9 @@ import org.gcube.portal.notifications.thread.MessageNotificationsThread; import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; import org.gcube.vomanagement.usermanagement.model.GCubeUser; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; import com.sun.mail.util.MailSSLSocketFactory; /** @@ -68,7 +68,7 @@ import com.sun.mail.util.MailSSLSocketFactory; * */ public class PeriodicTask implements Runnable { - private static final Logger _log = LoggerFactory.getLogger(PeriodicTask.class); + private static final Log _log = LogFactoryUtil.getLog(PeriodicTask.class); private static final String APP_ID_NEWSFEED = "org.gcube.portlets.user.newsfeed.server.NewsServiceImpl"; private DatabookStore socialStore; @@ -89,7 +89,7 @@ public class PeriodicTask implements Runnable { @Override public void run() { - _log.info("PeriodicTask starting for portal/site having name: " + popAccount.getPortalName()); + _log.debug("PeriodicTask starting for portal/site having name: " + popAccount.getPortalName()); check(popAccount.getPortalName(), popAccount.getPop3Server(), popAccount.getPop3user(), popAccount.getPop3password()); } @@ -250,7 +250,7 @@ public class PeriodicTask implements Runnable { e1.printStackTrace(); } - _log.debug("Found message reply, subject: " + subject, " body: " + messageText); + _log.debug("Found message reply, subject: " + subject + " body: " + messageText); String newMessageId = null; Workspace workspace; List recipientIds = null; @@ -274,14 +274,14 @@ public class PeriodicTask implements Runnable { _log.debug("Constructing reply message"); messageText += getReplyHeaderMessage(sender, originalSentTime, originalText); - _log.debug("Trying to send message with subject: " + subject, " to: " + recipientIds.toString()); + _log.debug("Trying to send message with subject: " + subject + " to: " + recipientIds.toString()); newMessageId = messageManager.sendMessageToPortalLogins(subject, messageText, new ArrayList(), recipientIds); } catch (WorkspaceFolderNotFoundException | InternalErrorException | HomeNotFoundException | ItemNotFoundException e) { e.printStackTrace(); } - _log.debug("Message with subject: " + subject, " hase been sent, returned id: " + newMessageId); + _log.debug("Message with subject: " + subject + " hase been sent, returned id: " + newMessageId); if (newMessageId != null) { _log.debug("Sending message notifications ... site server URL= " + site.getSiteURL());