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
This commit is contained in:
Massimiliano Assante 2016-07-27 16:46:30 +00:00
parent c36199d773
commit 6cd25ea0a9
1 changed files with 7 additions and 7 deletions

View File

@ -57,9 +57,9 @@ import org.gcube.portal.notifications.thread.MessageNotificationsThread;
import org.gcube.vomanagement.usermanagement.UserManager; import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager; import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
import org.gcube.vomanagement.usermanagement.model.GCubeUser; 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; import com.sun.mail.util.MailSSLSocketFactory;
/** /**
@ -68,7 +68,7 @@ import com.sun.mail.util.MailSSLSocketFactory;
* *
*/ */
public class PeriodicTask implements Runnable { 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 static final String APP_ID_NEWSFEED = "org.gcube.portlets.user.newsfeed.server.NewsServiceImpl";
private DatabookStore socialStore; private DatabookStore socialStore;
@ -89,7 +89,7 @@ public class PeriodicTask implements Runnable {
@Override @Override
public void run() { 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()); check(popAccount.getPortalName(), popAccount.getPop3Server(), popAccount.getPop3user(), popAccount.getPop3password());
} }
@ -250,7 +250,7 @@ public class PeriodicTask implements Runnable {
e1.printStackTrace(); e1.printStackTrace();
} }
_log.debug("Found message reply, subject: " + subject, " body: " + messageText); _log.debug("Found message reply, subject: " + subject + " body: " + messageText);
String newMessageId = null; String newMessageId = null;
Workspace workspace; Workspace workspace;
List<String> recipientIds = null; List<String> recipientIds = null;
@ -274,14 +274,14 @@ public class PeriodicTask implements Runnable {
_log.debug("Constructing reply message"); _log.debug("Constructing reply message");
messageText += getReplyHeaderMessage(sender, originalSentTime, originalText); 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<String>(), recipientIds); newMessageId = messageManager.sendMessageToPortalLogins(subject, messageText, new ArrayList<String>(), recipientIds);
} catch (WorkspaceFolderNotFoundException | InternalErrorException | HomeNotFoundException | ItemNotFoundException e) { } catch (WorkspaceFolderNotFoundException | InternalErrorException | HomeNotFoundException | ItemNotFoundException e) {
e.printStackTrace(); 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) { if (newMessageId != null) {
_log.debug("Sending message notifications ... site server URL= " + site.getSiteURL()); _log.debug("Sending message notifications ... site server URL= " + site.getSiteURL());