From 647099f8a9099095f2944ea6906225484cbdbd4a Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 19 Sep 2019 10:22:47 +0530 Subject: [PATCH] Adding debug logs to query-devices API --- .../mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 31c5981c899..91770d28ea7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -653,11 +653,17 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { DeviceList deviceList = new DeviceList(); try { if(map.getProperties().isEmpty()){ + if (log.isDebugEnabled()) { + log.debug("No search criteria defined when querying devices."); + } return Response.status(Response.Status.BAD_REQUEST).entity("No search criteria defined.").build(); } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); devices = dms.getDevicesBasedOnProperties(map.getProperties()); if(devices == null || devices.isEmpty()){ + if (log.isDebugEnabled()) { + log.debug("No Devices Found for criteria : " + map); + } return Response.status(Response.Status.NOT_FOUND).entity("No device found matching query criteria.").build(); } } catch (DeviceManagementException e) {