debugging logs added

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2024-04-12 16:00:56 +02:00
parent f65486e9c0
commit 0419a89420
1 changed files with 12 additions and 5 deletions

View File

@ -349,7 +349,7 @@ public class Notifications {
// check if the token belongs to an application token. In this case use J.A.R.V.I.S (the username used to communicate with Liferay)
String username = null;
String fullName = "";
logger.debug("Catalogue Notification called by " + caller.getClient().getId() + " isUser?"+TokensUtils.isUserToken(caller));
logger.info("Catalogue Notification called by " + caller.getClient().getId() + " isUser?"+TokensUtils.isUserToken(caller));
if(!TokensUtils.isUserToken(caller)){
GCubeUser jarvis = UserManagerWSBuilder.getInstance().getUserManager().getUserByEmail(LiferayJSONWsCredentials.getSingleton().getUser());
SecurityTokenProvider.instance.set(LiferayJSONWsCredentials.getSingleton().getNotifierUserToken());
@ -365,14 +365,16 @@ public class Notifications {
String context = ScopeProvider.instance.get();
logger.debug("catalogue notifications from user = " + username);
logger.info("catalogue notifications from user = " + username);
ResponseBean responseBean = new ResponseBean();
Status status = Status.OK;
boolean deliveryResult = false;
try {
logger.debug("catalogue notifications type is " + event.getType());
logger.info("catalogue notifications type is " + event.getType());
SocialNetworkingSite site = SocialNetworkingSiteFinder.getSocialNetworkingSiteFromScope(context);
logger.info("social networking site is " + site.getName());
logger.info("context is " + context);
logger.info("user is " + user.getUsername());
NotificationsManager nm = new ApplicationNotificationsManager(UserManagerWSBuilder.getInstance().getUserManager(), site, context, user);
@ -392,7 +394,12 @@ public class Notifications {
responseBean.setMessage("Username not found, got: " + userIdToNotify);
return Response.status(status).entity(responseBean).build();
}
logger.info("username2notify " + username2Notify);
logger.info("type is " + CatalogueEventTypeMapper.getType(event.getType()));
logger.info("item id is " + event.getItemId());
logger.info("item text is " + event.getNotifyText());
logger.info("item url is " + event.getItemURL());
deliveryResult =
nm.notifyCatalogueEvent(
CatalogueEventTypeMapper.getType(event.getType()),