usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mru...@apache.org
Subject [6/7] usergrid git commit: USERGRID-1243: logging overhaul, pt. 2
Date Tue, 02 Feb 2016 16:42:43 GMT
USERGRID-1243: logging overhaul, pt. 2


Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/54e62f95
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/54e62f95
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/54e62f95

Branch: refs/heads/master
Commit: 54e62f95c17158392d65141eb09ba2e94adb46c9
Parents: 71fb610
Author: Mike Dunker <mdunker@apigee.com>
Authored: Mon Feb 1 14:28:52 2016 -0800
Committer: Mike Dunker <mdunker@apigee.com>
Committed: Mon Feb 1 14:28:52 2016 -0800

----------------------------------------------------------------------
 .../management/AppInfoMigrationPlugin.java      |   2 +-
 .../cassandra/ManagementServiceImpl.java        |  71 +++++-----
 .../usergrid/management/export/ExportJob.java   |   7 +-
 .../management/export/ExportServiceImpl.java    |   7 +-
 .../management/export/S3ExportImpl.java         |   2 +-
 .../management/importer/FileImportJob.java      |   6 +-
 .../usergrid/management/importer/ImportJob.java |   8 +-
 .../management/importer/ImportServiceImpl.java  | 135 +++++++++----------
 .../management/importer/S3ImportImpl.java       |   4 +-
 .../usergrid/security/AuthPrincipalType.java    |   4 +-
 .../security/crypto/EncryptionServiceImpl.java  |   8 +-
 .../usergrid/security/oauth/AccessInfo.java     |   2 +-
 .../security/providers/AbstractProvider.java    |   4 +-
 .../security/providers/FacebookProvider.java    |   4 +-
 .../security/providers/FoursquareProvider.java  |   4 +-
 .../apache/usergrid/security/shiro/Realm.java   |   6 +-
 .../usergrid/security/shiro/ShiroCache.java     |  21 +--
 .../security/shiro/ShiroCacheManager.java       |   2 +-
 .../shiro/principals/PrincipalIdentifier.java   |   8 +-
 .../security/shiro/utils/SubjectUtils.java      |   4 +-
 .../usergrid/security/tokens/TokenCategory.java |   4 +-
 .../services/AbstractCollectionService.java     |  39 +++---
 .../services/AbstractConnectionsService.java    |  12 +-
 .../AbstractPathBasedColllectionService.java    |  10 +-
 .../usergrid/services/AbstractService.java      |   4 +-
 .../apache/usergrid/services/ServiceInfo.java   |   2 +-
 .../usergrid/services/ServiceManager.java       |  16 +--
 .../usergrid/services/ServiceParameter.java     |  44 ++----
 .../usergrid/services/ServiceResults.java       |   8 +-
 .../services/activities/ActivitiesService.java  |   4 +-
 .../applications/ApplicationsService.java       |   6 +-
 .../usergrid/services/assets/AssetsService.java |  12 +-
 .../services/assets/data/AssetMimeHandler.java  |   4 +-
 .../services/assets/data/AssetUtils.java        |   4 +-
 .../assets/data/AwsSdkS3BinaryStore.java        |   6 +-
 .../assets/data/LocalFileBinaryStore.java       |   4 +-
 .../services/assets/data/S3BinaryStore.java     |  36 ++---
 .../services/devices/DevicesService.java        |  12 +-
 .../notifications/NotificationsService.java     |   4 +-
 .../usergrid/services/groups/GroupsService.java |   8 +-
 .../groups/activities/ActivitiesService.java    |   4 +-
 .../notifications/NotificationsService.java     |   4 +-
 .../services/groups/roles/RolesService.java     |   4 +-
 .../services/groups/users/UsersService.java     |   4 +-
 .../users/activities/ActivitiesService.java     |   4 +-
 .../groups/users/devices/DevicesService.java    |   4 +-
 .../notifications/NotificationsService.java     |   4 +-
 .../services/messages/MessagesService.java      |   4 +-
 .../notifications/ApplicationQueueMessage.java  |   2 +-
 .../notifications/InactiveDeviceManager.java    |   8 +-
 .../services/notifications/JobScheduler.java    |   8 +-
 .../notifications/NotificationsService.java     |  16 ++-
 .../services/notifications/QueueJob.java        |  16 ++-
 .../services/notifications/QueueListener.java   |  48 +++++--
 .../services/notifications/TaskManager.java     |  36 +++--
 .../notifications/apns/APNsAdapter.java         |   4 +-
 .../apns/RejectedAPNsListener.java              |   4 +-
 .../services/notifications/gcm/GCMAdapter.java  |  16 ++-
 .../impl/ApplicationQueueManagerImpl.java       |  88 ++++++++----
 .../services/notifiers/NotifiersService.java    |   4 +-
 .../services/queues/ImportQueueListener.java    |   4 +-
 .../usergrid/services/queues/QueueListener.java |  50 +++++--
 .../usergrid/services/roles/RolesService.java   |   4 +-
 .../services/roles/groups/GroupsService.java    |   4 +-
 .../services/roles/users/UsersService.java      |   4 +-
 .../usergrid/services/users/UsersService.java   |   6 +-
 .../users/activities/ActivitiesService.java     |   4 +-
 .../services/users/devices/DevicesService.java  |  20 +--
 .../notifications/NotificationsService.java     |   4 +-
 .../users/following/FollowingService.java       |   4 +-
 .../services/users/groups/GroupsService.java    |   4 +-
 .../notifications/NotificationsService.java     |   4 +-
 .../services/users/roles/RolesService.java      |   4 +-
 .../org/apache/usergrid/utils/PythonUtils.java  |   4 +-
 .../usergrid/cassandra/CassandraResource.java   |   2 +-
 75 files changed, 529 insertions(+), 423 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java b/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
index d14a855..2412bec 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/AppInfoMigrationPlugin.java
@@ -143,7 +143,7 @@ public class AppInfoMigrationPlugin implements MigrationPlugin {
         if ( version == getMaxVersion() ) {
 
             if (logger.isDebugEnabled()) {
-                logger.debug("Skipping Migration Plugin: " + getName());
+                logger.debug("Skipping Migration Plugin: {}", getName());
             }
 
             return;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
index a3a6aa9..bf9dbfe 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/cassandra/ManagementServiceImpl.java
@@ -448,8 +448,8 @@ public class ManagementServiceImpl implements ManagementService {
     public OrganizationOwnerInfo createOwnerAndOrganization( String organizationName, String username, String name,
                                                              String email, String password ) throws Exception {
 
-        if(logger.isDebugEnabled()){
-            logger.debug("createOwnerAndOrganization1");
+        if(logger.isTraceEnabled()){
+            logger.trace("createOwnerAndOrganization(1)");
         }
         boolean activated = !newAdminUsersNeedSysAdminApproval() && !newOrganizationsNeedSysAdminApproval();
         boolean disabled = newAdminUsersRequireConfirmation();
@@ -464,8 +464,8 @@ public class ManagementServiceImpl implements ManagementService {
     public OrganizationOwnerInfo createOwnerAndOrganization( String organizationName, String username, String name,
                                                              String email, String password, boolean activated,
                                                              boolean disabled ) throws Exception {
-        if(logger.isDebugEnabled()){
-            logger.debug("createOwnerAndOrganization2");
+        if(logger.isTraceEnabled()){
+            logger.trace("createOwnerAndOrganization(2)");
         }
         return createOwnerAndOrganization( organizationName, username, name, email, password,
                 activated, disabled, null, null );
@@ -479,9 +479,7 @@ public class ManagementServiceImpl implements ManagementService {
                                                              Map<String, Object> organizationProperties )
             throws Exception {
 
-        if(logger.isDebugEnabled()){
-            logger.debug("createOwnerAndOrganization3");
-        }
+        logger.info("createOwnerAndOrganization: {} {}", organizationName, email);
 
         /**
          * Only lock on the target values. We don't want lock contention if another
@@ -516,8 +514,8 @@ public class ManagementServiceImpl implements ManagementService {
                 user = createAdminUserInternal( null, username, name, email, password, activated, disabled, userProperties );
             }
 
-            if(logger.isDebugEnabled()){
-                logger.debug("User created");
+            if(logger.isTraceEnabled()){
+                logger.debug("createOwnerAndOrganization: User created");
             }
             organization = createOrganizationInternal( null, organizationName, user, true, organizationProperties );
         }
@@ -533,8 +531,8 @@ public class ManagementServiceImpl implements ManagementService {
 
     private OrganizationInfo createOrganizationInternal(
         UUID orgUuid, String organizationName, UserInfo user, boolean activated ) throws Exception {
-        if(logger.isDebugEnabled()){
-            logger.debug("createOrganizationInternal1");
+        if(logger.isTraceEnabled()){
+            logger.trace("createOrganizationInternal(1): {}", organizationName);
         }
         return createOrganizationInternal( orgUuid, organizationName, user, activated, null );
     }
@@ -543,8 +541,8 @@ public class ManagementServiceImpl implements ManagementService {
     private OrganizationInfo createOrganizationInternal( UUID orgUuid, String organizationName, UserInfo user, boolean activated,
                                                          Map<String, Object> properties ) throws Exception {
 
-        if(logger.isDebugEnabled()){
-            logger.debug( "createOrganizationInternal2: {}", organizationName );
+        if(logger.isTraceEnabled()){
+            logger.trace( "createOrganizationInternal(2): {}", organizationName );
         }
 
         if (  organizationName == null ) {
@@ -555,7 +553,7 @@ public class ManagementServiceImpl implements ManagementService {
         }
         if ( user == null ) {
             if(logger.isDebugEnabled()){
-                logger.debug("user = null");
+                logger.debug("user = null (organizationName = {})", organizationName);
             }
             return null;
         }
@@ -611,11 +609,15 @@ public class ManagementServiceImpl implements ManagementService {
             throws Exception {
 
         if (  organizationName == null ) {
-            logger.debug("organizationName = null");
+            if (logger.isTraceEnabled()) {
+                logger.trace("organizationName = null");
+            }
             return null;
         }
         if ( user == null ) {
-            logger.debug("user = null");
+            if (logger.isTraceEnabled()) {
+                logger.trace("user = null");
+            }
             return null;
         }
 
@@ -1140,11 +1142,15 @@ public class ManagementServiceImpl implements ManagementService {
                         Identifier.fromUUID( UUID.fromString( identifierString ) ) );
                 if ( entity != null ) {
                     user = ( User ) entity.toTypedEntity();
-                    logger.info( "Found user {} as a UUID", identifierString );
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Found user {} as a UUID", identifierString);
+                    }
                 }
             }
             catch ( Exception e ) {
-                logger.warn( "Unable to get user " + identifierString + " as a UUID, trying username..." );
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Unable to get user {} as a UUID, trying username...", identifierString);
+                }
             }
             return user;
         }
@@ -1155,12 +1161,13 @@ public class ManagementServiceImpl implements ManagementService {
             Entity entity = getUserEntityByIdentifier( applicationId, identifier );
             if ( entity != null ) {
                 user = ( User ) entity.toTypedEntity();
-                logger.info( "Found user {} as an {}", identifierString, identifier.getType() );
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Found user {} as an {}", identifierString, identifier.getType());
+                }
             }
         }
         catch ( Exception e ) {
-            logger.warn( "Unable to get user {} as a {}", identifierString, identifier.getType());
-            logger.warn( "Exception", e);
+            logger.warn( "Unable to get user {} as a {}", identifierString, identifier.getType(), e);
         }
         if ( user != null ) {
             return user;
@@ -1255,8 +1262,8 @@ public class ManagementServiceImpl implements ManagementService {
 
     public int calculatePasswordHistorySizeForUser( UUID userId ) throws Exception {
 
-        if(logger.isDebugEnabled()){
-            logger.debug( "calculatePasswordHistorySizeForUser " + userId.toString() );
+        if(logger.isTraceEnabled()){
+            logger.trace( "calculatePasswordHistorySizeForUser {}", userId.toString() );
         }
 
         int size = 0;
@@ -1265,8 +1272,8 @@ public class ManagementServiceImpl implements ManagementService {
         Results orgResults = em.getCollection( new SimpleEntityRef( User.ENTITY_TYPE, userId ),
                 Schema.COLLECTION_GROUPS, null, 10000, Level.REFS, false );
 
-        if(logger.isDebugEnabled()){
-            logger.debug("    orgResults.size() = " + orgResults.size());
+        if(logger.isTraceEnabled()){
+            logger.trace("    orgResults.size() = {}", orgResults.size());
         }
 
         for ( EntityRef orgRef : orgResults.getRefs() ) {
@@ -1275,8 +1282,8 @@ public class ManagementServiceImpl implements ManagementService {
             if ( properties != null ) {
                 OrganizationInfo orgInfo = new OrganizationInfo( null, null, properties );
 
-                if(logger.isDebugEnabled()){
-                    logger.debug( "    orgInfo.getPasswordHistorySize() = " +  orgInfo.getPasswordHistorySize() );
+                if(logger.isTraceEnabled()){
+                    logger.trace( "    orgInfo.getPasswordHistorySize() = {}", orgInfo.getPasswordHistorySize() );
                 }
 
                 size = Math.max( orgInfo.getPasswordHistorySize(), size );
@@ -1301,8 +1308,8 @@ public class ManagementServiceImpl implements ManagementService {
     @Override
     public UserInfo verifyAdminUserPasswordCredentials( String name, String password ) throws Exception {
 
-        if(logger.isDebugEnabled()){
-            logger.debug("verifyAdminUserPasswordCredentials for {}/{}", name, password);
+        if(logger.isTraceEnabled()){
+            logger.trace("verifyAdminUserPasswordCredentials for {}", name);
         }
 
         User user = findUserEntity( smf.getManagementAppId(), name );
@@ -1547,7 +1554,7 @@ public class ManagementServiceImpl implements ManagementService {
                 try {
                     organizations.put( entity.getUuid(), path );
                 } catch (IllegalArgumentException e) {
-                    logger.warn("Error adding " + entity.getUuid() + ":" + path + " to BiMap: " + e.getMessage() );
+                    logger.warn("Error adding {}:{} to BiMap: {}", entity.getUuid(), path, e.getMessage() );
                 }
             }
 
@@ -1653,7 +1660,7 @@ public class ManagementServiceImpl implements ManagementService {
 
         if(em.getCollection(organization.getUuid() ,"users",Query.fromQL( "select * where uuid ="+user.getUuid() ),Level.IDS ).size() >0){
             if(logger.isDebugEnabled()) {
-                logger.debug( "Found value: {} already in collection", user.getName() );
+                logger.debug( "addAdminUserToOrganization - Found value: {} already in collection", user.getName() );
             }
             return;
         }
@@ -2385,7 +2392,7 @@ public class ManagementServiceImpl implements ManagementService {
             }
         }
         catch ( Exception e ) {
-            logger.error( "Unable to send activation emails to " + organization.getName(), e );
+            logger.error( "Unable to send activation emails to {}", organization.getName(), e );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
index 3bdfac9..03c3353 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportJob.java
@@ -40,7 +40,9 @@ public class ExportJob extends OnlyOnceJob {
     ExportService exportService;
 
     public ExportJob() {
-        logger.info( "ExportJob created " + this );
+        if (logger.isTraceEnabled()) {
+            logger.trace("ExportJob created");
+        }
     }
 
 
@@ -59,8 +61,7 @@ public class ExportJob extends OnlyOnceJob {
             exportService.doExport( jobExecution );
         }
         catch ( Exception e ) {
-            logger.error( "Export Service failed to complete job" );
-            logger.error(e.getMessage());
+            logger.error( "Export Service failed to complete job: {}", e.getMessage() );
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
index 31e8544..eadc925 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/ExportServiceImpl.java
@@ -87,7 +87,7 @@ public class ExportServiceImpl implements ExportService {
             return null;
         }
 
-        EntityManager em = null;
+        EntityManager em;
         try {
             em = emf.getEntityManager( emf.getManagementAppId() );
             Set<String> collections = em.getApplicationCollections();
@@ -188,9 +188,10 @@ public class ExportServiceImpl implements ExportService {
 
     @Override
     public void doExport( final JobExecution jobExecution ) throws Exception {
+        @SuppressWarnings("unchecked")
         Map<String, Object> config = ( Map<String, Object> ) jobExecution.getJobData().getProperty( "exportInfo" );
         Object s3PlaceHolder = jobExecution.getJobData().getProperty( "s3Export" );
-        S3Export s3Export = null;
+        S3Export s3Export;
 
         if ( config == null ) {
             logger.error( "Export Information passed through is null" );
@@ -222,7 +223,7 @@ public class ExportServiceImpl implements ExportService {
         }
 
         if ( config.get( "organizationId" ) == null ) {
-            logger.error( "No organization could be found" );
+            logger.error( "doExport: No organization could be found" );
             export.setState( Export.State.FAILED );
             em.update( export );
             return;

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
index f8005d1..c09e4d2 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/export/S3ExportImpl.java
@@ -72,7 +72,7 @@ public class S3ExportImpl implements S3Export {
         try {
             BlobStore blobStore = context.getBlobStore();
             if ( blobStore.createContainerInLocation(null, bucketName) ) {
-                logger.info( "Created bucket " + bucketName );
+                logger.info( "Created bucket {}", bucketName );
             }
         }
         catch ( Exception ex ) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
index f734b3f..be0b943 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/FileImportJob.java
@@ -48,7 +48,9 @@ public class FileImportJob extends OnlyOnceJob {
     ImportService importService;
 
     public FileImportJob() {
-        logger.info( "FileImportJob created " + this );
+        if (logger.isTraceEnabled()) {
+            logger.info("FileImportJob created");
+        }
     }
 
     @Override
@@ -81,7 +83,7 @@ public class FileImportJob extends OnlyOnceJob {
             throw t;
         }
 
-        logger.info("File Import Service completed job: " + jobExecution.getJobName() );
+        logger.info("File Import Service completed job: {}", jobExecution.getJobName() );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
index 4640681..935f12c 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportJob.java
@@ -47,7 +47,9 @@ public class ImportJob extends OnlyOnceJob {
     ImportService importService;
 
     public ImportJob(){
-        logger.info( "ImportJob created " + this );
+        if (logger.isTraceEnabled()) {
+            logger.info("ImportJob created");
+        }
     }
 
     @Override
@@ -82,7 +84,9 @@ public class ImportJob extends OnlyOnceJob {
             throw t;
         }
 
-        logger.error("Import Service completed job");
+        if (logger.isTraceEnabled()) {
+            logger.trace("Import Service completed job");
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
index 2f1b994..6c1ffc0 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/ImportServiceImpl.java
@@ -94,7 +94,7 @@ public class ImportServiceImpl implements ImportService {
         try {
             rootEM = emf.getEntityManager(emf.getManagementAppId());
         } catch (Exception e) {
-            logger.error("application doesn't exist within the current context");
+            logger.error("application doesn't exist within the current context", e);
             return null;
         }
 
@@ -105,7 +105,7 @@ public class ImportServiceImpl implements ImportService {
         try {
             importEntity = rootEM.create(importEntity);
         } catch (Exception e) {
-            logger.error("Import entity creation failed");
+            logger.error("Import entity creation failed", e);
             return null;
         }
 
@@ -313,9 +313,9 @@ public class ImportServiceImpl implements ImportService {
      */
     private JobData createFileTask(Map<String, Object> config, String file, EntityRef importRef) throws Exception {
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("scheduleFile() for import {}:{} file {}",
-                new Object[]{importRef.getType(), importRef.getType(), file});
+        if (logger.isTraceEnabled()) {
+            logger.trace("scheduleFile() for import {}:{} file {}",
+                importRef.getType(), importRef.getType(), file);
         }
 
         EntityManager rootEM;
@@ -338,16 +338,15 @@ public class ImportServiceImpl implements ImportService {
             // create a connection between the main import job and the sub FileImport Job
             rootEM.createConnection(importEntity, IMPORT_FILE_INCLUDES_CONNECTION, fileImport);
 
-            if (logger.isDebugEnabled()) {
-                logger.debug("Created connection from {}:{} to {}:{}",
-                    new Object[]{
+            if (logger.isTraceEnabled()) {
+                logger.trace("Created connection from {}:{} to {}:{}",
                         importEntity.getType(), importEntity.getUuid(),
                         fileImport.getType(), fileImport.getUuid()
-                    });
+                    );
             }
 
         } catch (Exception e) {
-            logger.error(e.getMessage());
+            logger.error("Exception creating file task connection", e.getMessage());
             return null;
         }
 
@@ -523,21 +522,21 @@ public class ImportServiceImpl implements ImportService {
     @Override
     public void doImport(JobExecution jobExecution) throws Exception {
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("doImport()");
+        if (logger.isTraceEnabled()) {
+            logger.trace("doImport()");
         }
 
-        Map<String, Object> config =
-            (Map<String, Object>) jobExecution.getJobData().getProperty("importInfo");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> config = (Map<String, Object>) jobExecution.getJobData().getProperty("importInfo");
         if (config == null) {
             logger.error("doImport(): Import Information passed through is null");
             return;
         }
 
-        Map<String, Object> properties =
-            (Map<String, Object>) config.get("properties");
-        Map<String, Object> storage_info =
-            (Map<String, Object>) properties.get("storage_info");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> properties = (Map<String, Object>) config.get("properties");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> storage_info = (Map<String, Object>) properties.get("storage_info");
 
         String bucketName = (String) storage_info.get("bucket_location");
         String accessId = (String) storage_info.get("s3_access_id");
@@ -553,8 +552,8 @@ public class ImportServiceImpl implements ImportService {
         importEntity.setStarted(System.currentTimeMillis());
         importEntity.setErrorMessage(" ");
         rootEM.update(importEntity);
-        if (logger.isDebugEnabled()) {
-            logger.debug("doImport(): updated state");
+        if (logger.isTraceEnabled()) {
+            logger.trace("doImport(): updated state");
         }
 
         // if no S3 importer was passed in then create one
@@ -633,13 +632,13 @@ public class ImportServiceImpl implements ImportService {
                 final int count = getConnectionCount(importEntity);
 
                 if (count == fileJobs.size()) {
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Got ALL {} of {} expected connections", count, fileJobs.size());
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Got ALL {} of {} expected connections", count, fileJobs.size());
                     }
                     done = true;
                 } else {
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Got {} of {} expected connections. Waiting...", count, fileJobs.size());
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Got {} of {} expected connections. Waiting...", count, fileJobs.size());
                     }
                     Thread.sleep(1000);
                 }
@@ -673,14 +672,14 @@ public class ImportServiceImpl implements ImportService {
 
         // get values we need
 
-        Map<String, Object> properties =
-            (Map<String, Object>) jobExecution.getJobData().getProperty("properties");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> properties = (Map<String, Object>) jobExecution.getJobData().getProperty("properties");
         if (properties == null) {
             logger.error("downloadAndImportFile(): Import Information passed through is null");
             return;
         }
-        Map<String, Object> storage_info =
-            (Map<String, Object>) properties.get("storage_info");
+        @SuppressWarnings("unchecked")
+        Map<String, Object> storage_info = (Map<String, Object>) properties.get("storage_info");
 
         String bucketName = (String) storage_info.get("bucket_location");
         String accessId = (String) storage_info.get("s3_access_id");
@@ -805,6 +804,7 @@ public class ImportServiceImpl implements ImportService {
             try {
                 Thread.sleep(5000);
             } catch (Exception intentionallyIgnored) {
+                // intentionally ignored
             }
 
             // get file import entities for this import job
@@ -818,13 +818,13 @@ public class ImportServiceImpl implements ImportService {
             PagingResultsIterator itr = new PagingResultsIterator(entities);
 
             if (!itr.hasNext()) {
-                logger.warn("Found no FileImport entities for import {}, " +
-                    "unable to check if complete", importEntity.getUuid());
+                logger.warn("Found no FileImport entities for import {}, unable to check if complete",
+                        importEntity.getUuid());
                 return;
             }
 
-            if (logger.isDebugEnabled()) {
-                logger.debug("Checking {} file import jobs to see if we are done for file {}",
+            if (logger.isTraceEnabled()) {
+                logger.trace("Checking {} file import jobs to see if we are done for file {}",
                     new Object[]{entities.size(), fileImport.getFileName()});
             }
 
@@ -842,7 +842,7 @@ public class ImportServiceImpl implements ImportService {
                         continue;
                     default:         // not something we recognize as complete, short circuit
                         if (logger.isDebugEnabled()) {
-                            logger.debug("not done yet, bail out...");
+                            logger.debug("not done yet, bail out... {}", fi.getState().toString());
                         }
                         return;
                 }
@@ -857,13 +857,13 @@ public class ImportServiceImpl implements ImportService {
             }
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("successCount = {} failCount = {}", new Object[]{successCount, failCount});
+        if (logger.isTraceEnabled()) {
+            logger.trace("successCount = {} failCount = {}", successCount, failCount);
         }
 
         if (importEntity != null) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("FINISHED");
+            if (logger.isTraceEnabled()) {
+                logger.trace("FINISHED");
             }
 
             if (failCount == 0) {
@@ -875,9 +875,9 @@ public class ImportServiceImpl implements ImportService {
 
             try {
                 rootEM.update(importEntity);
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Updated import entity {}:{} with state {}",
-                        new Object[]{importEntity.getType(), importEntity.getUuid(), importEntity.getState()});
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Updated import entity {}:{} with state {}",
+                        importEntity.getType(), importEntity.getUuid(), importEntity.getState());
                 }
             } catch (Exception e) {
                 logger.error("Error updating import entity", e);
@@ -945,14 +945,13 @@ public class ImportServiceImpl implements ImportService {
         // FIRST PASS: import all entities in the file
 
 
-        boolean entitiesOnly = true;
-
         // observable that parses JSON and emits write events
         JsonParser jp = getJsonParserForFile(file);
 
         // TODO: move JSON parser into observable creation so open/close happens within the stream
+        // entitiesOnly = true
         final JsonEntityParserObservable jsonObservableEntities =
-            new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, entitiesOnly);
+            new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, true);
 
         final Observable<WriteEvent> entityEventObservable = Observable.create(jsonObservableEntities);
 
@@ -970,28 +969,27 @@ public class ImportServiceImpl implements ImportService {
         jp.close();
 
         if (FileImport.State.FAILED.equals(fileImport.getState())) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("\n\nFailed to completely write entities, skipping second phase. File: {}\n",
+            if (logger.isTraceEnabled()) {
+                logger.trace("\n\nFailed to completely write entities, skipping second phase. File: {}\n",
                     fileImport.getFileName());
             }
             return;
         }
-        if (logger.isDebugEnabled()) {
-            logger.debug("\n\nWrote entities. File: {}\n", fileImport.getFileName());
+        if (logger.isTraceEnabled()) {
+            logger.trace("\n\nWrote entities. File: {}\n", fileImport.getFileName());
         }
 
 
         // SECOND PASS: import all connections and dictionaries
 
 
-        entitiesOnly = false;
-
         // observable that parses JSON and emits write events
         jp = getJsonParserForFile(file);
 
         // TODO: move JSON parser into observable creation so open/close happens within the stream
+        // entitiesOnly = false
         final JsonEntityParserObservable jsonObservableOther =
-            new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, entitiesOnly);
+            new JsonEntityParserObservable(jp, em, rootEm, fileImport, tracker, false);
 
         final Observable<WriteEvent> otherEventObservable = Observable.create(jsonObservableOther);
 
@@ -1008,8 +1006,8 @@ public class ImportServiceImpl implements ImportService {
 
         jp.close();
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("\n\nparseEntitiesAndConnectionsFromJson(): Wrote others for file {}\n",
+        if (logger.isTraceEnabled()) {
+            logger.trace("\n\nparseEntitiesAndConnectionsFromJson(): Wrote others for file {}\n",
                 fileImport.getFileName());
         }
 
@@ -1025,14 +1023,14 @@ public class ImportServiceImpl implements ImportService {
 
         if (FileImport.State.FAILED.equals(fileImport.getState())) {
             if (logger.isDebugEnabled()) {
-                logger.debug("\n\nFailed to completely wrote connections and dictionaries. File: {}\n",
+                logger.debug("\n\nFailed to completely write connections and dictionaries. File: {}\n",
                     fileImport.getFileName());
             }
             return;
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("\n\nWrote connections and dictionaries. File: {}\n", fileImport.getFileName());
+        if (logger.isTraceEnabled()) {
+            logger.trace("\n\nWrote connections and dictionaries. File: {}\n", fileImport.getFileName());
         }
     }
 
@@ -1058,9 +1056,9 @@ public class ImportServiceImpl implements ImportService {
         @Override
         public void doWrite(EntityManager em, FileImport fileImport, FileImportTracker tracker) {
             try {
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Writing imported entity {}:{} into app {}",
-                        new Object[]{entityType, entityUuid, em.getApplication().getUuid()});
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Writing imported entity {}:{} into app {}",
+                        entityType, entityUuid, em.getApplication().getUuid());
                 }
 
                 em.create(entityUuid, entityType, properties);
@@ -1068,7 +1066,7 @@ public class ImportServiceImpl implements ImportService {
                 tracker.entityWritten();
 
             } catch (Exception e) {
-                logger.error("Error writing entity. From file:" + fileImport.getFileName(), e);
+                logger.error("Error writing entity. From file:{}", fileImport.getFileName(), e);
 
                 tracker.entityFailed(e.getMessage() + " From file: " + fileImport.getFileName());
             }
@@ -1100,11 +1098,10 @@ public class ImportServiceImpl implements ImportService {
                     entityRef = em.get(ownerEntityRef.getUuid());
                 }
 
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Creating connection from {}:{} to {}:{}",
-                        new Object[]{
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Creating connection from {}:{} to {}:{}",
                             ownerEntityRef.getType(), ownerEntityRef.getUuid(),
-                            entityRef.getType(), entityRef.getUuid()});
+                            entityRef.getType(), entityRef.getUuid());
                 }
 
                 em.createConnection(ownerEntityRef, connectionType, entityRef);
@@ -1112,7 +1109,7 @@ public class ImportServiceImpl implements ImportService {
                 tracker.connectionWritten();
 
             } catch (Exception e) {
-                logger.error("Error writing connection. From file: " + fileImport.getFileName(), e);
+                logger.error("Error writing connection. From file: {}", fileImport.getFileName(), e);
 
                 tracker.connectionFailed(e.getMessage() + " From file: " + fileImport.getFileName());
             }
@@ -1137,9 +1134,9 @@ public class ImportServiceImpl implements ImportService {
         public void doWrite(EntityManager em, FileImport fileImport, FileImportTracker stats) {
             try {
 
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Adding map to {}:{} dictionary {}",
-                        new Object[]{ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName});
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Adding map to {}:{} dictionary {}",
+                        ownerEntityRef.getType(), ownerEntityRef.getType(), dictionaryName);
                 }
 
                 em.addMapToDictionary(ownerEntityRef, dictionaryName, dictionary);
@@ -1298,8 +1295,8 @@ public class ImportServiceImpl implements ImportService {
                     subscriber.onCompleted();
                 }
 
-                if (logger.isDebugEnabled()) {
-                    logger.debug("process(): done parsing JSON");
+                if (logger.isTraceEnabled()) {
+                    logger.trace("process(): done parsing JSON");
                 }
 
             } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java b/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
index f44902f..674596f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/management/importer/S3ImportImpl.java
@@ -120,8 +120,8 @@ public class S3ImportImpl implements S3Import {
         PageSet<? extends StorageMetadata> pageSets =
             blobStore.list(bucketName, new ListContainerOptions().recursive());
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("   Found {} files in bucket {}", pageSets.size(), bucketName);
+        if (logger.isTraceEnabled()) {
+            logger.trace("   Found {} files in bucket {}", pageSets.size(), bucketName);
         }
 
         List<String> blobFileNames = new ArrayList<>();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java b/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
index 94456ad..c33db9f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/AuthPrincipalType.java
@@ -44,10 +44,10 @@ public enum AuthPrincipalType {
 
     private synchronized static void register( AuthPrincipalType type ) {
         if ( prefixes == null ) {
-            prefixes = new ConcurrentHashMap<String, AuthPrincipalType>();
+            prefixes = new ConcurrentHashMap<>();
         }
         if ( base64Prefixes == null ) {
-            base64Prefixes = new ConcurrentHashMap<String, AuthPrincipalType>();
+            base64Prefixes = new ConcurrentHashMap<>();
         }
         prefixes.put( type.getPrefix(), type );
         base64Prefixes.put( type.getBase64Prefix(), type );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java b/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
index 701abed..4e7e3df 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/crypto/EncryptionServiceImpl.java
@@ -57,7 +57,7 @@ public class EncryptionServiceImpl implements EncryptionService {
     public boolean verify( String inputSecret, CredentialsInfo creds, UUID userId, UUID applicationId ) {
 
 
-        String[] storedCommands = null;
+        String[] storedCommands;
 
         // We have the new format of crypto chain. read them and apply them
         if ( creds.getCryptoChain() != null && creds.getCryptoChain().length > 0 ) {
@@ -84,8 +84,7 @@ public class EncryptionServiceImpl implements EncryptionService {
             // verify we have a command to load
             if ( command == null ) {
                 throw new IllegalArgumentException( String.format(
-                        "No command implementat for name %s exists, yet it is persisted on a user's credentials info."
-                                + "  This means their credentials either need removed, or this command needs supported",
+                        "No command implementation for name %s exists, yet it is persisted on a user's credentials info.  This means their credentials either need to be removed, or this command needs to be supported",
                         commandName ) );
             }
 
@@ -97,7 +96,6 @@ public class EncryptionServiceImpl implements EncryptionService {
     }
 
 
-    /** @param wiredCommands the wiredCommands to set */
     @Autowired
     public void setCommands( List<EncryptionCommand> inputCommands ) {
         this.inputCommands = inputCommands;
@@ -112,7 +110,7 @@ public class EncryptionServiceImpl implements EncryptionService {
                             EncryptionCommand.class ) );
         }
 
-        commands = new HashMap<String, EncryptionCommand>();
+        commands = new HashMap<>();
 
         /**
          * Create the map by name so we can reference them later.

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java b/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
index 67529e0..f7bda45 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/oauth/AccessInfo.java
@@ -41,7 +41,7 @@ public class AccessInfo {
     String state;
     Long passwordChanged;
 
-    protected Map<String, Object> properties = new TreeMap<String, Object>( String.CASE_INSENSITIVE_ORDER );
+    protected Map<String, Object> properties = new TreeMap<>( String.CASE_INSENSITIVE_ORDER );
 
 
     public AccessInfo() {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
index 24d6b9f..61924d1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/AbstractProvider.java
@@ -72,7 +72,7 @@ public abstract class AbstractProvider implements SignInAsProvider {
         try {
             return entityManager.getDictionaryAsMap(entityManager.getApplication(), providerKey);
         } catch (Exception ex) {
-            logger.error("Error in loadConfigurationFor for " + providerKey, ex);
+            logger.error("Error in loadConfigurationFor for {}", providerKey, ex);
         }
         return null;
     }
@@ -82,7 +82,7 @@ public abstract class AbstractProvider implements SignInAsProvider {
         try {
             entityManager.addMapToDictionary(entityManager.getApplication(), providerKey, config);
         } catch (Exception ex) {
-            logger.error("Error in saveToConfiguration for " + providerKey, ex);
+            logger.error("Error in saveToConfiguration for {}", providerKey, ex);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
index a39ebea..e86052e 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FacebookProvider.java
@@ -112,7 +112,7 @@ public class FacebookProvider extends AbstractProvider {
         String fb_user_email = ( String ) fb_user.get( "email" );
 
         if ( logger.isDebugEnabled() ) {
-            logger.debug( JsonUtils.mapToFormattedJsonString( fb_user ) );
+            logger.debug( "FacebookProvider.createOrAuthenticate: {}", JsonUtils.mapToFormattedJsonString( fb_user ) );
         }
 
         User user = null;
@@ -128,7 +128,7 @@ public class FacebookProvider extends AbstractProvider {
                 throw new BadTokenException( "Could not lookup user for that Facebook ID", ex );
             }
             if ( r.size() > 1 ) {
-                logger.error( "Multiple users for FB ID: " + fb_user_id );
+                logger.error( "Multiple users for FB ID: {}", fb_user_id );
                 throw new BadTokenException( "multiple users with same Facebook ID" );
             }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
index bcefe67..324e774 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/providers/FoursquareProvider.java
@@ -110,7 +110,7 @@ public class FoursquareProvider extends AbstractProvider {
         location.put( "longitude", ( Double ) fq_location.get( "lng" ) );
 
         if ( logger.isDebugEnabled() ) {
-            logger.debug( JsonUtils.mapToFormattedJsonString( location ) );
+            logger.debug( "FoursquareProvider.createOrAuthenticate: {}", JsonUtils.mapToFormattedJsonString( location ) );
         }
 
         // Only the first name is guaranteed to be here
@@ -129,7 +129,7 @@ public class FoursquareProvider extends AbstractProvider {
                 Results r = entityManager.searchCollection( entityManager.getApplicationRef(), "users", query );
 
                 if ( r.size() > 1 ) {
-                    logger.error( "Multiple users for FQ ID: " + fq_user_id );
+                    logger.error( "Multiple users for FQ ID: {}", fq_user_id );
                     throw new BadTokenException( "multiple users with same Foursquare ID" );
                 }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
index 6d43fff..4381f01 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/Realm.java
@@ -109,7 +109,7 @@ public class Realm extends AuthorizingRealm {
     public void setPermissionResolver( PermissionResolver permissionResolver ) {
         if ( !( permissionResolver instanceof CustomPermissionResolver ) ) {
             if (logger.isDebugEnabled()) {
-                logger.debug("Replacing {} with AllowAllCredentialsMatcher", permissionResolver);
+                logger.debug("Replacing {} with CustomPermissionResolver", permissionResolver);
             }
             permissionResolver = new CustomPermissionResolver();
         }
@@ -201,8 +201,8 @@ public class Realm extends AuthorizingRealm {
             throw new AuthenticationException( "Unable to authenticate" );
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("Authenticated: {}", principal);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Authenticated: {}", principal);
         }
 
         return new SimpleAuthenticationInfo( pcToken.getPrincipal(), pcToken.getCredentials(), getName() );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
index 03b23fa..4fe569f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCache.java
@@ -60,23 +60,16 @@ public class ShiroCache<K, V> implements Cache<K,V> {
         if ( scopedCache != null ) {
             V value = scopedCache.get(getKeyString(key), typeRef);
 
-            if ( logger.isDebugEnabled() ) {
+            if ( logger.isTraceEnabled() ) {
                 if (value instanceof UsergridAuthorizationInfo) {
                     UsergridAuthorizationInfo info = (UsergridAuthorizationInfo) value;
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Got from AUTHZ cache {} for app {}", getKeyString(key), info.toString());
-                    }
-
+                    logger.trace("Got from AUTHZ cache {} for app {}", getKeyString(key), info.toString());
                 } else if (value instanceof UsergridAuthenticationInfo) {
                     UsergridAuthenticationInfo info = (UsergridAuthenticationInfo) value;
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Got from AUTHC cache {} for app {}", getKeyString(key), info.toString());
-                    }
+                    logger.trace("Got from AUTHC cache {} for app {}", getKeyString(key), info.toString());
 
                 } else if (value == null) {
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Got NULL from cache app {} for key {}", getKeyString(key), key.toString());
-                    }
+                    logger.trace("Got NULL from cache app {} for key {}", getKeyString(key), key.toString());
                 }
             }
 
@@ -93,14 +86,14 @@ public class ShiroCache<K, V> implements Cache<K,V> {
         if ( scopedCache != null ) {
             V ret = scopedCache.put(getKeyString(key), value, cacheTtl);
 
-            if ( logger.isDebugEnabled() ) {
+            if ( logger.isTraceEnabled() ) {
                 if (value instanceof UsergridAuthorizationInfo) {
                     UsergridAuthorizationInfo info = (UsergridAuthorizationInfo) value;
-                    logger.debug("Put to AUTHZ cache {} for app {}", getKeyString(key), info.toString());
+                    logger.trace("Put to AUTHZ cache {} for app {}", getKeyString(key), info.toString());
 
                 } else if (value instanceof UsergridAuthenticationInfo) {
                     UsergridAuthenticationInfo info = (UsergridAuthenticationInfo) value;
-                    logger.debug("Put to AUTHC cache {} for app {}", getKeyString(key), info.toString());
+                    logger.trace("Put to AUTHC cache {} for app {}", getKeyString(key), info.toString());
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
index 17d5cce..a3c3062 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/ShiroCacheManager.java
@@ -80,7 +80,7 @@ public class ShiroCacheManager implements CacheManager {
                     getCacheTtl());
 
             } else {
-                logger.error("Unknown Shiro Cache name: " + name);
+                logger.error("Unknown Shiro Cache name: {}", name);
                 throw new RuntimeException("Unknown Shiro Cache name: " + name);
             }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
index b1bf749..41a1d0d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/principals/PrincipalIdentifier.java
@@ -84,16 +84,16 @@ public abstract class PrincipalIdentifier {
 
 
     protected void grant( UsergridAuthorizationInfo info, String permission ) {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Principal {} granted permission: {}", this, permission);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Principal {} granted permission: {}", this, permission);
         }
         info.addStringPermission(permission);
     }
 
 
     protected void role( UsergridAuthorizationInfo info, String role ) {
-        if (logger.isDebugEnabled()) {
-            logger.debug("Principal {} added to role: {}", this, role);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Principal {} added to role: {}", this, role);
         }
         info.addRole(role);
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java b/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
index ac4be06..3b4b37d 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/shiro/utils/SubjectUtils.java
@@ -429,8 +429,8 @@ public class SubjectUtils {
             currentUser.checkPermission( permission );
         }
         catch ( org.apache.shiro.authz.UnauthenticatedException e ) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("checkPermission(): Subject is anonymous");
+            if (logger.isTraceEnabled()) {
+                logger.trace("checkPermission(): Subject is anonymous");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java b/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
index 121901d..f5a2e03 100644
--- a/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
+++ b/stack/services/src/main/java/org/apache/usergrid/security/tokens/TokenCategory.java
@@ -38,10 +38,10 @@ public enum TokenCategory {
 
     private synchronized static void register( TokenCategory type ) {
         if ( prefixes == null ) {
-            prefixes = new ConcurrentHashMap<String, TokenCategory>();
+            prefixes = new ConcurrentHashMap<>();
         }
         if ( base64Prefixes == null ) {
-            base64Prefixes = new ConcurrentHashMap<String, TokenCategory>();
+            base64Prefixes = new ConcurrentHashMap<>();
         }
         prefixes.put( type.getPrefix(), type );
         base64Prefixes.put( type.getBase64Prefix(), type );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
index 42906c6..fbb4cc6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractCollectionService.java
@@ -94,8 +94,8 @@ public class AbstractCollectionService extends AbstractService {
         }
 
         if ( entity == null ) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("miss on entityType: {} with uuid: {}", getEntityType(), id);
+            if (logger.isTraceEnabled()) {
+                logger.trace("miss on entityType: {} with uuid: {}", getEntityType(), id);
             }
             String msg = "Cannot find entity associated with uuid: " + id;
             throw new EntityNotFoundException( msg );
@@ -120,9 +120,9 @@ public class AbstractCollectionService extends AbstractService {
         // the context of the entity they're trying to load isn't owned by the owner
         // in the path, don't return it
         if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
-            logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}", new Object[] {
+            logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}",
                     getEntityType(), id, context.getOwner()
-            } );
+            );
             throw new ServiceResourceNotFoundException( context );
         }
 
@@ -153,8 +153,8 @@ public class AbstractCollectionService extends AbstractService {
 
         if ( entity == null ) {
 
-            if (logger.isDebugEnabled()) {
-                logger.debug("miss on entityType: {} with name: {}", getEntityType(), name);
+            if (logger.isTraceEnabled()) {
+                logger.trace("miss on entityType: {} with name: {}", getEntityType(), name);
             }
 
             String msg = "Cannot find entity with name: "+name;
@@ -164,9 +164,9 @@ public class AbstractCollectionService extends AbstractService {
         // the context of the entity they're trying to load isn't owned by the owner
         // in the path, don't return it
         if ( !em.isCollectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
-            logger.info( "Someone tried to GET entity {} they don't own. Entity name {} with owner {}", new Object[] {
+            logger.info( "Someone tried to GET entity {} they don't own. Entity name {} with owner {}",
                     getEntityType(), name, context.getOwner()
-            } );
+            );
             throw new ServiceResourceNotFoundException( context );
         }
 
@@ -246,8 +246,8 @@ public class AbstractCollectionService extends AbstractService {
             return getItemsByQuery( context, new Query() );
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("Limiting collection to " + Query.DEFAULT_LIMIT);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Limiting collection to {}", Query.DEFAULT_LIMIT);
         }
 
         int count = Query.DEFAULT_LIMIT;
@@ -356,16 +356,16 @@ public class AbstractCollectionService extends AbstractService {
             List<Entity> entities = new ArrayList<Entity>();
             List<Map<String, Object>> batch = context.getPayload().getBatchProperties();
 
-            if (logger.isDebugEnabled()) {
-                logger.debug("Attempting to batch create " + batch.size() + " entities in collection " + context
-                    .getCollectionName());
+            if (logger.isTraceEnabled()) {
+                logger.trace("Attempting to batch create {} entities in collection {}",
+                        batch.size(), context.getCollectionName());
             }
 
             int i = 1;
 
             for ( Map<String, Object> p : batch ) {
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Creating entity " + i + " in collection " + context.getCollectionName());
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Creating entity {} in collection {}", i, context.getCollectionName());
                 }
 
                 Entity item = null;
@@ -377,17 +377,16 @@ public class AbstractCollectionService extends AbstractService {
                 catch ( Exception e ) {
                     // TODO should we not log this as error?
                     if (logger.isDebugEnabled()) {
-                        logger.debug("Entity " + i + " unable to be created in collection " + context.getCollectionName(),
+                        logger.debug("Entity {} unable to be created in collection {}", i, context.getCollectionName(),
                             e);
                     }
 
                     i++;
                     continue;
                 }
-                if (logger.isDebugEnabled()) {
-                    logger.debug(
-                        "Entity " + i + " created in collection " + context.getCollectionName() + " with UUID " + item
-                            .getUuid());
+                if (logger.isTraceEnabled()) {
+                    logger.trace(
+                        "Entity {} created in collection {} with UUID {}", i, context.getCollectionName(), item.getUuid());
                 }
 
                 item = importEntity( context, item );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
index ca539e0..94b25d3 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractConnectionsService.java
@@ -218,9 +218,9 @@ public class AbstractConnectionsService extends AbstractService {
         // the context of the entity they're trying to load isn't owned by the owner
         // in the path, don't return it
         if ( !em.isConnectionMember( context.getOwner(), context.getCollectionName(), entity ) ) {
-            logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}", new Object[] {
+            logger.info( "Someone tried to GET entity {} they don't own. Entity id {} with owner {}",
                     getEntityType(), id, context.getOwner()
-            } );
+            );
             throw new ServiceResourceNotFoundException( context );
         }
 
@@ -286,8 +286,8 @@ public class AbstractConnectionsService extends AbstractService {
             count = Query.MAX_LIMIT;
             level = Level.ALL_PROPERTIES;
 
-            if (logger.isDebugEnabled()) {
-            	logger.debug("Query does not have more parameters, overwriting limit to: {} and level to {}" ,
+            if (logger.isTraceEnabled()) {
+            	logger.trace("Query does not have more parameters, overwriting limit to: {} and level to {}" ,
                     count, level.name());
             }
         }
@@ -306,8 +306,8 @@ public class AbstractConnectionsService extends AbstractService {
 
         if ( connecting() ) {
             if ( query.hasQueryPredicates() ) {
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Attempted query of backwards connections");
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Attempted query of backwards connections");
                 }
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
index 8bd02ea..2d5b7e1 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractPathBasedColllectionService.java
@@ -95,14 +95,18 @@ public class AbstractPathBasedColllectionService extends AbstractCollectionServi
                     }
                 }
                 if ( !isEmpty( aliases ) ) {
-                    logger.info( "Found {} potential paths", aliases.size() );
+                    if (logger.isTraceEnabled()) {
+                        logger.trace("Found {} potential paths", aliases.size());
+                    }
                     Map<String, EntityRef> aliasedEntities = em.getAlias( getEntityType(), aliases );
                     for ( int i = aliases.size() - 1; i >= 0; i-- ) {
                         alias = aliases.get( i );
                         pathEntity = aliasedEntities.get( alias );
                         if ( pathEntity != null ) {
-                            logger.info( "Found entity {} of type {} for alias {}",
-                                    new Object[] { pathEntity.getUuid(), pathEntity.getType(), alias } );
+                            if (logger.isTraceEnabled()) {
+                                logger.trace("Found entity {} of type {} for alias {}",
+                                        pathEntity.getUuid(), pathEntity.getType(), alias);
+                            }
                             parameters = parameters.subList( i + 1, parameters.size() );
                             first_parameter = new IdParameter( pathEntity.getUuid() );
                             // if (!isEmpty(parameters)) {

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
index 8dd9afa..5d818cc 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/AbstractService.java
@@ -560,7 +560,7 @@ public abstract class AbstractService implements Service {
             entity.addProperties( payload.getProperties() );
             return entity;
         }
-        logger.error("Attempted update of entity reference rather than full entity, currently unsupport - MUSTFIX");
+        logger.error("Attempted update of entity reference rather than full entity, currently unsupported");
         throw new NotImplementedException();
     }
 
@@ -1365,7 +1365,7 @@ public abstract class AbstractService implements Service {
         boolean permitted = currentUser.isPermitted( perm );
 
         if ( logger.isDebugEnabled() ) {
-            logger.debug( PATH_MSG, new Object[] { path, context.getAction(), perm, permitted } );
+            logger.debug( PATH_MSG, path, context.getAction(), perm, permitted );
         }
 
         SubjectUtils.checkPermission( perm );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
index eb65c0e..4f6ce2f 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceInfo.java
@@ -256,7 +256,7 @@ public class ServiceInfo {
             return servicePatternCache.get( servicePattern );
         }
         catch ( ExecutionException ee ) {
-            logger.error("Error in getClassName for service pattern: "+servicePattern, ee);
+            logger.error("Error in getClassName for service pattern: {}", servicePattern, ee);
         }
 
         return _getClassName( servicePattern );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
index b428229..c439b49 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceManager.java
@@ -107,7 +107,7 @@ public class ServiceManager {
                 applicationId = application.getUuid();
             }
             catch ( Exception e ) {
-                logger.error( "This should never happen", e );
+                logger.error( "ServiceManager init failure", e );
                 throw new RuntimeException( e );
             }
         }
@@ -210,8 +210,8 @@ public class ServiceManager {
             return null;
         }
 
-        if (logger.isDebugEnabled()) {
-            logger.debug("Looking up service pattern: {}", serviceType);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Looking up service pattern: {}", serviceType);
         }
 
         ServiceInfo info = ServiceInfo.getServiceInfo( serviceType );
@@ -223,8 +223,8 @@ public class ServiceManager {
         Service service = getServiceInstance( info );
 
         if ( service != null ) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Returning service instance: {}", service.getClass());
+            if (logger.isTraceEnabled()) {
+                logger.trace("Returning service instance: {}", service.getClass());
             }
         }
 
@@ -280,8 +280,8 @@ public class ServiceManager {
 
         Class<Service> cls;
         try {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Attempting to instantiate service class {}", classname);
+            if (logger.isTraceEnabled()) {
+                logger.trace("Attempting to instantiate service class {}", classname);
             }
             cls = ( Class<Service> ) Class.forName( classname );
             if ( cls.isInterface() ) {
@@ -328,7 +328,7 @@ public class ServiceManager {
                 s = cls.newInstance();
             }
             catch ( Exception e ) {
-                logger.error( "cannot instantiate " + cls.getName(), e );
+                logger.error( "cannot instantiate {}", cls.getName(), e );
             }
             if ( s instanceof AbstractService ) {
                 AbstractService as = ( ( AbstractService ) s );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
index 6e8a072..533992b 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceParameter.java
@@ -127,7 +127,7 @@ public abstract class ServiceParameter {
     public static List<ServiceParameter> addParameter( List<ServiceParameter> parameters, Query query ) {
 
         if ( parameters == null ) {
-            parameters = new ArrayList<ServiceParameter>();
+            parameters = new ArrayList<>();
         }
 
         if ( query == null ) {
@@ -135,7 +135,7 @@ public abstract class ServiceParameter {
         }
 
         if ( lastParameterIsQuery( parameters ) ) {
-            logger.error( "Adding two queries in a row" );
+            logger.info( "Adding two queries in a row" );
         }
 
         ServiceParameter p = new QueryParameter( query );
@@ -148,7 +148,7 @@ public abstract class ServiceParameter {
             throws Exception {
 
         if ( parameters == null ) {
-            parameters = new ArrayList<ServiceParameter>();
+            parameters = new ArrayList<>();
         }
 
         if ( params == null ) {
@@ -177,59 +177,37 @@ public abstract class ServiceParameter {
 
 
     public static boolean firstParameterIsName( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( 0 ).isName();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get( 0 ).isName();
     }
 
 
     public static boolean lastParameterIsName( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( parameters.size() - 1 ).isName();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isName();
     }
 
 
     public static boolean firstParameterIsQuery( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( 0 ).isQuery();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get( 0 ).isQuery();
     }
 
 
     public static boolean lastParameterIsQuery( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( parameters.size() - 1 ).isQuery();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isQuery();
     }
 
 
     public static boolean firstParameterIsId( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( 0 ).isId();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get(0).isId();
     }
 
 
     public static boolean lastParameterIsId( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( parameters.size() - 1 ).isId();
-        }
-        return false;
+        return !isEmpty(parameters) && parameters.get( parameters.size() - 1 ).isId();
     }
 
 
     public static ServiceParameter firstParameter( List<ServiceParameter> parameters ) {
-        if ( !isEmpty( parameters ) ) {
-            return parameters.get( 0 );
-        }
-
-        return null;
+        return !isEmpty(parameters) ? parameters.get(0) : null;
     }
 
 
@@ -329,7 +307,7 @@ public abstract class ServiceParameter {
             if ( !found ) {
                 continue;
             }
-            ArrayList<ServiceParameter> p = new ArrayList<ServiceParameter>();
+            ArrayList<ServiceParameter> p = new ArrayList<>();
             for ( String name : replaceSet.getValue() ) {
                 if ( name.startsWith( "\\" ) ) {
                     int i = Integer.parseInt( name.substring( 1 ) );

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java b/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
index de3c012..868cb68 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/ServiceResults.java
@@ -73,8 +73,8 @@ public class ServiceResults extends Results {
         }
         this.serviceMetadata = serviceMetadata;
         this.nextRequests = nextRequests;
-        if (logger.isDebugEnabled()) {
-            logger.debug("Child path: {}", childPath);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Child path: {}", childPath);
         }
     }
 
@@ -95,8 +95,8 @@ public class ServiceResults extends Results {
         }
         this.serviceMetadata = serviceMetadata;
         this.nextRequests = nextRequests;
-        if (logger.isDebugEnabled()) {
-            logger.debug("Child path: {}", childPath);
+        if (logger.isTraceEnabled()) {
+            logger.trace("Child path: {}", childPath);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java b/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
index 02105bf..348b442 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/activities/ActivitiesService.java
@@ -29,8 +29,8 @@ public class ActivitiesService extends AbstractCollectionService {
 
     public ActivitiesService() {
         super();
-        if (logger.isDebugEnabled()) {
-            logger.debug("/activities");
+        if (logger.isTraceEnabled()) {
+            logger.trace("/activities");
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
index 515721a..ae524c6 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/applications/ApplicationsService.java
@@ -49,8 +49,8 @@ public class ApplicationsService extends AbstractService {
 
     public ApplicationsService() {
         super();
-        if (logger.isDebugEnabled()) {
-            logger.debug("/applications");
+        if (logger.isTraceEnabled()) {
+            logger.trace("/applications");
         }
         declareEntityDictionary( "counters" );
         declareEntityCommand( "hello" );
@@ -149,7 +149,7 @@ public class ApplicationsService extends AbstractService {
 
                     em.createApplicationCollection( collection );
                     if (logger.isDebugEnabled()) {
-                        logger.debug("Created collection " + collection + " for application " + sm.getApplicationId());
+                        logger.debug("Created collection {} for application {}", collection, sm.getApplicationId());
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
index f313e4a..41aaa82 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/AssetsService.java
@@ -34,8 +34,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
 
     public AssetsService() {
         super();
-        if (logger.isDebugEnabled()) {
-            logger.debug("/assets");
+        if (logger.isTraceEnabled()) {
+            logger.trace("/assets");
         }
         declareServiceCommands( "data" );
     }
@@ -44,8 +44,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
     @Override
     public ServiceResults getEntityCommand( ServiceContext context, List<EntityRef> refs, String command )
             throws Exception {
-        if (logger.isDebugEnabled()) {
-            logger.debug("handling command: {}", command);
+        if (logger.isTraceEnabled()) {
+            logger.trace("handling command: {}", command);
         }
 
         ServiceResults sr = ServiceResults.genericServiceResults();
@@ -56,8 +56,8 @@ public class AssetsService extends AbstractPathBasedColllectionService {
 
     @Override
     public ServiceResults getServiceCommand( ServiceContext context, String command ) throws Exception {
-        if (logger.isDebugEnabled()) {
-            logger.debug("in getServiceCommand with command: {}", command);
+        if (logger.isTraceEnabled()) {
+            logger.trace("in getServiceCommand with command: {}", command);
         }
         return ServiceResults.genericServiceResults();
     }

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
index 1ecc9e7..b1822ea 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetMimeHandler.java
@@ -37,7 +37,7 @@ import org.apache.tika.mime.MediaType;
 
 /** Detect the mime type of an Asset */
 public final class AssetMimeHandler {
-    private static final Logger LOG = LoggerFactory.getLogger( AssetMimeHandler.class );
+    private static final Logger logger = LoggerFactory.getLogger( AssetMimeHandler.class );
 
     private Detector detector;
 
@@ -98,7 +98,7 @@ public final class AssetMimeHandler {
             fileMetadata.put( AssetUtils.CONTENT_TYPE, mediaType.toString() );
         }
         catch ( IOException e ) {
-            LOG.error( "error detecting mime type", e );
+            logger.error( "error detecting mime type", e );
         }
 
         return mediaType.toString();

http://git-wip-us.apache.org/repos/asf/usergrid/blob/54e62f95/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
index 91ad9cc..48ad1ba 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/assets/data/AssetUtils.java
@@ -34,7 +34,7 @@ import com.google.common.base.Preconditions;
 
 
 public class AssetUtils {
-    private static final Logger LOG = LoggerFactory.getLogger( AssetUtils.class );
+    private static final Logger logger = LoggerFactory.getLogger( AssetUtils.class );
 
     public static final String FILE_METADATA = "file-metadata";
     public static final String CONTENT_TYPE = "content-type";
@@ -62,7 +62,7 @@ public class AssetUtils {
                 moded = DateUtils.parseDate( headerValue, DEFAULT_PATTERNS );
             }
             catch ( ParseException pe ) {
-                LOG.error( "Could not parse date format from If-Modified-Since header: " + headerValue );
+                logger.error( "Could not parse date format from If-Modified-Since header: {}", headerValue );
             }
         }
         return moded;


Mime
View raw message