ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-ranger git commit: RANGER-794: performance measurement instrumentation updates to use better logger names
Date Mon, 18 Jan 2016 16:20:41 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master 5b169d42d -> f79bc59a0


RANGER-794: performance measurement instrumentation updates to use better logger names

Signed-off-by: Madhan Neethiraj <madhan@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/f79bc59a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/f79bc59a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/f79bc59a

Branch: refs/heads/master
Commit: f79bc59a0b4756ca5195a2ffb30759b4a82175ef
Parents: 5b169d4
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Wed Jan 13 11:56:04 2016 -0800
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Mon Jan 18 08:20:09 2016 -0800

----------------------------------------------------------------------
 .../contextenricher/RangerTagEnricher.java      | 24 +++----
 .../policyengine/RangerPolicyEngineImpl.java    | 68 +++++++++++---------
 .../policyengine/RangerPolicyRepository.java    | 22 ++-----
 .../RangerCachedPolicyEvaluator.java            | 24 -------
 .../RangerDefaultPolicyEvaluator.java           | 36 ++++-------
 .../RangerDefaultPolicyItemEvaluator.java       | 31 ++++++---
 .../RangerOptimizedPolicyEvaluator.java         | 10 ---
 .../ranger/plugin/util/PolicyRefresher.java     |  7 +-
 .../ranger/plugin/util/RangerPerfTracer.java    |  9 ++-
 agents-common/src/test/resources/log4j.xml      | 59 +++++++++--------
 ranger-tools/conf/log4j.properties              |  4 +-
 .../src/test/resources/log4j.properties         |  4 +-
 ranger-tools/testdata/test_modules.txt          | 19 +++++-
 .../apache/ranger/biz/RangerTagDBRetriever.java |  2 +-
 14 files changed, 144 insertions(+), 175 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java
b/agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java
index c8fc056..9d3d201 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/contextenricher/RangerTagEnricher.java
@@ -44,7 +44,7 @@ import java.util.Map;
 public class RangerTagEnricher extends RangerAbstractContextEnricher {
 	private static final Log LOG = LogFactory.getLog(RangerTagEnricher.class);
 
-	private static final Log PERF_ENRICHER_LOG = RangerPerfTracer.getPerfLogger("enricher");
+	private static final Log PERF_CONTEXTENRICHER_INIT_LOG = RangerPerfTracer.getPerfLogger("contextenricher.init");
 
 	public static final String TAG_REFRESHER_POLLINGINTERVAL_OPTION = "tagRefresherPollingInterval";
 
@@ -143,12 +143,6 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher
{
 
 		if (CollectionUtils.isNotEmpty(serviceResources)) {
 
-			RangerPerfTracer perf = null;
-
-			if(RangerPerfTracer.isPerfTraceEnabled(PERF_ENRICHER_LOG)) {
-				perf = RangerPerfTracer.getPerfTracer(PERF_ENRICHER_LOG, "RangerTagEnricher.setServiceTags(serviceName="
+ tagRetriever.getServiceName() + ",lastKnownVersion=" + serviceTags.getTagVersion() + ")");
-			}
-
 			for (RangerServiceResource serviceResource : serviceResources) {
 				RangerDefaultPolicyResourceMatcher matcher = new RangerDefaultPolicyResourceMatcher();
 
@@ -164,10 +158,8 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher
{
 
 				RangerServiceResourceMatcher serviceResourceMatcher = new RangerServiceResourceMatcher(serviceResource,
matcher);
 				resourceMatchers.add(serviceResourceMatcher);
-
 			}
 
-			RangerPerfTracer.log(perf);
 		}
 
 		this.serviceResourceMatchers = resourceMatchers;
@@ -310,8 +302,15 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher
{
 					} else {
 						break;
 					}
+					RangerPerfTracer perf = null;
+
+					if(RangerPerfTracer.isPerfTraceEnabled(PERF_CONTEXTENRICHER_INIT_LOG)) {
+						perf = RangerPerfTracer.getPerfTracer(PERF_CONTEXTENRICHER_INIT_LOG, "RangerTagRefresher.populateTags(serviceName="
+ tagRetriever.getServiceName() + ",lastKnownVersion=" + lastKnownVersion + ")");
+					}
 					populateTags();
 
+					RangerPerfTracer.log(perf);
+
 				} catch (InterruptedException excp) {
 					LOG.debug("RangerTagRefresher(pollingIntervalMs=" + pollingIntervalMs + ").run() : interrupted!
Exiting thread", excp);
 					break;
@@ -327,11 +326,7 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher
{
 
 			if (tagEnricher != null) {
 				ServiceTags serviceTags = null;
-				RangerPerfTracer perf = null;
 
-				if(RangerPerfTracer.isPerfTraceEnabled(PERF_ENRICHER_LOG)) {
-					perf = RangerPerfTracer.getPerfTracer(PERF_ENRICHER_LOG, "RangerTagRefresher.populateTags(serviceName="
+ tagRetriever.getServiceName() + ",lastKnownVersion=" + lastKnownVersion + ")");
-				}
 				serviceTags = tagRetriever.retrieveTags(lastKnownVersion);
 
 				if (serviceTags == null) {
@@ -342,8 +337,6 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher {
 					saveToCache(serviceTags);
 				}
 
-				RangerPerfTracer.log(perf);
-
 				if (serviceTags != null) {
 					tagEnricher.setServiceTags(serviceTags);
 					LOG.info("RangerTagRefresher.populateTags() - Updated tags-cache to new version of tags,
lastKnownVersion=" + lastKnownVersion + "; newVersion=" + serviceTags.getTagVersion());
@@ -354,6 +347,7 @@ public class RangerTagEnricher extends RangerAbstractContextEnricher {
 						LOG.debug("RangerTagRefresher.populateTags() - No need to update tags-cache. lastKnownVersion="
+ lastKnownVersion);
 					}
 				}
+
 			} else {
 				LOG.error("RangerTagRefresher.populateTags() - no tag receiver to update tag-cache");
 			}

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
index df6ca41..6222f47 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyEngineImpl.java
@@ -37,8 +37,11 @@ import java.util.*;
 
 public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 	private static final Log LOG = LogFactory.getLog(RangerPolicyEngineImpl.class);
-	private static final Log PERF_POLICY_LOG = RangerPerfTracer.getPerfLogger("policy");
-	private static final Log PERF_ENRICHER_LOG = RangerPerfTracer.getPerfLogger("enricher");
+
+	private static final Log PERF_POLICYENGINE_INIT_LOG = RangerPerfTracer.getPerfLogger("policyengine.init");
+	private static final Log PERF_POLICYENGINE_REQUEST_LOG = RangerPerfTracer.getPerfLogger("policyengine.request");
+	private static final Log PERF_POLICYENGINE_AUDIT_LOG = RangerPerfTracer.getPerfLogger("policyengine.audit");
+	private static final Log PERF_CONTEXTENRICHER_REQUEST_LOG = RangerPerfTracer.getPerfLogger("contextenricher.request");
 
 	private final RangerPolicyRepository policyRepository;
 	private final RangerPolicyRepository tagPolicyRepository;
@@ -52,8 +55,8 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.init(appId="
+ appId + ",hashCode=" + Integer.toHexString(System.identityHashCode(this)) + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_INIT_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_INIT_LOG, "RangerPolicyEngine.init(appId="
+ appId + ",hashCode=" + Integer.toHexString(System.identityHashCode(this)) + ")");
 		}
 
 		if (options == null) {
@@ -138,17 +141,19 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 
 		if(!CollectionUtils.isEmpty(enrichers)) {
 
-			RangerPerfTracer perf = null;
+			for(RangerContextEnricher enricher : enrichers) {
 
-			if(RangerPerfTracer.isPerfTraceEnabled(PERF_ENRICHER_LOG)) {
-				perf = RangerPerfTracer.getPerfTracer(PERF_ENRICHER_LOG, "RangerPolicyEngine.preProcess(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
-			}
+				RangerPerfTracer perf = null;
+
+				if(RangerPerfTracer.isPerfTraceEnabled(PERF_CONTEXTENRICHER_REQUEST_LOG)) {
+					perf = RangerPerfTracer.getPerfTracer(PERF_CONTEXTENRICHER_REQUEST_LOG, "RangerContextEnricher.enrich(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ", enricherName=" + enricher.getName()
+ ")");
+				}
 
-			for(RangerContextEnricher enricher : enrichers) {
 				enricher.enrich(request);
+
+				RangerPerfTracer.log(perf);
 			}
 
-			RangerPerfTracer.log(perf);
 		}
 
 
@@ -191,14 +196,22 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 		}
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.isAccessAllowed(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_REQUEST_LOG, "RangerPolicyEngine.isAccessAllowed(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
 		}
 
 		RangerAccessResult ret = isAccessAllowedNoAudit(request);
 
 		if (resultProcessor != null) {
+
+			RangerPerfTracer perfAuditTracer = null;
+			if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_AUDIT_LOG)) {
+				perfAuditTracer = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_AUDIT_LOG, "RangerPolicyEngine.processAudit(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
+			}
+
 			resultProcessor.processResult(ret);
+
+			RangerPerfTracer.log(perfAuditTracer);
 		}
 
 		RangerPerfTracer.log(perf);
@@ -246,8 +259,8 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.isAccessAllowed(user="
+ user + ",accessType=" + accessType + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_REQUEST_LOG, "RangerPolicyEngine.isAccessAllowed(user="
+ user + ",accessType=" + accessType + "resource=" + resource.getAsString() + ")");
 		}
 		boolean ret = false;
 
@@ -275,6 +288,11 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			LOG.debug("==> RangerPolicyEngineImpl.isAccessAllowed(" + resources + ", " + user +
", " + userGroups + ", " + accessType + ")");
 		}
 
+		RangerPerfTracer perf = null;
+
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_REQUEST_LOG, "RangerPolicyEngine.isAccessAllowed(user="
+ user + ",accessType=" + accessType + ")");
+		}
 		boolean ret = false;
 
 		for (RangerPolicyEvaluator evaluator : policyRepository.getPolicyEvaluators()) {
@@ -285,6 +303,8 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			}
 		}
 
+		RangerPerfTracer.log(perf);
+
 		if (LOG.isDebugEnabled()) {
 			LOG.debug("<== RangerPolicyEngineImpl.isAccessAllowed(" + resources + ", " + user +
", " + userGroups + ", " + accessType + "): " + ret);
 		}
@@ -346,12 +366,6 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			LOG.debug("==> RangerPolicyEngineImpl.isAccessAllowedNoAudit(" + request + ")");
 		}
 
-		RangerPerfTracer perf = null;
-
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.isAccessAllowedNoAudit(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
-		}
-
 		RangerAccessResult ret = createAccessResult(request);
 
 		if (ret != null && request != null) {
@@ -400,8 +414,6 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			}
 		}
 
-		RangerPerfTracer.log(perf);
-
 		if (LOG.isDebugEnabled()) {
 			LOG.debug("<== RangerPolicyEngineImpl.isAccessAllowedNoAudit(" + request + "): " +
ret);
 		}
@@ -414,12 +426,6 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			LOG.debug("==> RangerPolicyEngineImpl.isAccessAllowedForTagPolicies(" + request + ",
" + result + ")");
 		}
 
-		RangerPerfTracer perf = null;
-
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.isAccessAllowedForTagPolicies(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ")");
-		}
-
 		List<RangerPolicyEvaluator> evaluators = tagPolicyRepository.getPolicyEvaluators();
 
 		if (CollectionUtils.isNotEmpty(evaluators)) {
@@ -488,8 +494,6 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 			}
 		}
 
-		RangerPerfTracer.log(perf);
-
 		if (LOG.isDebugEnabled()) {
 			LOG.debug("<== RangerPolicyEngineImpl.isAccessAllowedForTagPolicies(" + request + ",
" + result + ")" );
 		}
@@ -552,8 +556,8 @@ public class RangerPolicyEngineImpl implements RangerPolicyEngine {
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerPolicyEngine.cleanUp(hashCode="
+ Integer.toHexString(System.identityHashCode(this)) + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_INIT_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_INIT_LOG, "RangerPolicyEngine.cleanUp(hashCode="
+ Integer.toHexString(System.identityHashCode(this)) + ")");
 		}
 		preCleanup();
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java
index 0cde01a..ee36d34 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyengine/RangerPolicyRepository.java
@@ -38,7 +38,8 @@ import java.util.*;
 
 public class RangerPolicyRepository {
     private static final Log LOG = LogFactory.getLog(RangerPolicyRepository.class);
-    private static final Log PERF_LOG = RangerPerfTracer.getPerfLogger("policy");
+
+    private static final Log PERF_CONTEXTENRICHER_INIT_LOG = RangerPerfTracer.getPerfLogger("contextenricher.init");
 
     private final String                      serviceName;
     private final String                      appId;
@@ -55,12 +56,6 @@ public class RangerPolicyRepository {
     RangerPolicyRepository(String appId, ServicePolicies servicePolicies, RangerPolicyEngineOptions
options) {
         super();
 
-        RangerPerfTracer perf = null;
-
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerPolicyRepository.init(appId="
+ appId + ",hashCode=" + Integer.toHexString(System.identityHashCode(this)) + ")");
-        }
-
         this.componentServiceName = this.serviceName = servicePolicies.getServiceName();
         this.componentServiceDef = this.serviceDef = servicePolicies.getServiceDef();
 
@@ -86,7 +81,6 @@ public class RangerPolicyRepository {
 
         init(options);
 
-        RangerPerfTracer.log(perf);
     }
 
     RangerPolicyRepository(String appId, ServicePolicies.TagPolicies tagPolicies, RangerPolicyEngineOptions
options,
@@ -332,8 +326,8 @@ public class RangerPolicyRepository {
 
         RangerPerfTracer perf = null;
 
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerPolicyRepository.buildContextEnricher(name="
+ enricherDef.getName() + ")");
+        if(RangerPerfTracer.isPerfTraceEnabled(PERF_CONTEXTENRICHER_INIT_LOG)) {
+            perf = RangerPerfTracer.getPerfTracer(PERF_CONTEXTENRICHER_INIT_LOG, "RangerContextEnricher.init(appId=",
appId + ",name=" + enricherDef.getName() + ")");
         }
 
         String name    = enricherDef != null ? enricherDef.getName()     : null;
@@ -373,12 +367,6 @@ public class RangerPolicyRepository {
 
         RangerPolicyEvaluator ret;
 
-        RangerPerfTracer perf = null;
-
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerPolicyRepository.buildPolicyEvaluator(name="
+ policy.getName() + ")");
-        }
-
         if(StringUtils.equalsIgnoreCase(options.evaluatorType, RangerPolicyEvaluator.EVALUATOR_TYPE_DEFAULT))
{
             ret = new RangerOptimizedPolicyEvaluator();
         } else if(StringUtils.equalsIgnoreCase(options.evaluatorType, RangerPolicyEvaluator.EVALUATOR_TYPE_OPTIMIZED))
{
@@ -389,8 +377,6 @@ public class RangerPolicyRepository {
 
         ret.init(policy, serviceDef, options);
 
-        RangerPerfTracer.log(perf);
-
         if(LOG.isDebugEnabled()) {
             LOG.debug("<== RangerPolicyRepository.buildPolicyEvaluator(" + policy + ","
+ serviceDef + "): " + ret);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerCachedPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerCachedPolicyEvaluator.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerCachedPolicyEvaluator.java
index 580447b..91a53d8 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerCachedPolicyEvaluator.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerCachedPolicyEvaluator.java
@@ -25,14 +25,11 @@ import org.apache.ranger.plugin.model.RangerPolicy;
 import org.apache.ranger.plugin.model.RangerServiceDef;
 import org.apache.ranger.plugin.policyengine.RangerAccessResource;
 import org.apache.ranger.plugin.policyengine.RangerPolicyEngineOptions;
-import org.apache.ranger.plugin.util.RangerPerfTracer;
 
 public class RangerCachedPolicyEvaluator extends RangerOptimizedPolicyEvaluator {
     private static final Log LOG = LogFactory.getLog(RangerCachedPolicyEvaluator.class);
-    private static final Log PERF_LOG = RangerPerfTracer.getPerfLogger("policy");
 
     private RangerResourceAccessCache cache = null;
-    private String perfTag;
 
     @Override
     public void init(RangerPolicy policy, RangerServiceDef serviceDef, RangerPolicyEngineOptions
options) {
@@ -40,23 +37,10 @@ public class RangerCachedPolicyEvaluator extends RangerOptimizedPolicyEvaluator
             LOG.debug("==> RangerCachedPolicyEvaluator.init()");
         }
 
-        StringBuffer perfTagBuffer = new StringBuffer();
-        perfTagBuffer.append("policyId=").append(policy.getId()).append(",policyName=").append(policy.getName());
-
-        perfTag = perfTagBuffer.toString();
-
-        RangerPerfTracer perf = null;
-
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerCachedPolicyEvaluator.init("
+ perfTag + ")");
-        }
-
         super.init(policy, serviceDef, options);
 
         cache = RangerResourceAccessCacheImpl.getInstance(serviceDef, policy);
 
-        RangerPerfTracer.log(perf);
-
         if(LOG.isDebugEnabled()) {
             LOG.debug("<== RangerCachedPolicyEvaluator.init()");
         }
@@ -70,12 +54,6 @@ public class RangerCachedPolicyEvaluator extends RangerOptimizedPolicyEvaluator
 
         boolean result = false;
 
-        RangerPerfTracer perf = null;
-
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerCachedPolicyEvaluator.isMatch("
+ perfTag + ",accessResource=" + resource.getAsString() + ")");
-        }
-
         // Check in the evaluator-owned cache for the match, if found return. else call super.isMatch(),
add result to cache
         RangerResourceAccessCache.LookupResult lookup = cache.lookup(resource);
 
@@ -95,8 +73,6 @@ public class RangerCachedPolicyEvaluator extends RangerOptimizedPolicyEvaluator
             }
         }
 
-        RangerPerfTracer.log(perf);
-
         if (LOG.isDebugEnabled()) {
             LOG.debug("<== RangerCachedPolicyEvaluator.isMatch(" + resource + "): " +
result);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
index 93fbcd4..8107459 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyEvaluator.java
@@ -49,7 +49,9 @@ import org.apache.ranger.plugin.util.RangerPerfTracer;
 
 public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator {
 	private static final Log LOG = LogFactory.getLog(RangerDefaultPolicyEvaluator.class);
-	private static final Log PERF_LOG = RangerPerfTracer.getPerfLogger("policy");
+
+	private static final Log PERF_POLICY_INIT_LOG = RangerPerfTracer.getPerfLogger("policy.init");
+	private static final Log PERF_POLICY_REQUEST_LOG = RangerPerfTracer.getPerfLogger("policy.request");
 
 	private RangerPolicyResourceMatcher     resourceMatcher          = null;
 	private List<RangerPolicyItemEvaluator> allowEvaluators          = null;
@@ -79,8 +81,8 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.init(" +
perfTag + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_INIT_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_INIT_LOG, "RangerPolicyEvaluator.init("
+ perfTag + ")");
 		}
 
 		super.init(policy, serviceDef, options);
@@ -125,8 +127,8 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.evaluate(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ","
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_REQUEST_LOG, "RangerPolicyEvaluator.evaluate(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + ","
 					+ perfTag + ")");
 		}
 
@@ -200,12 +202,6 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
             LOG.debug("==> RangerDefaultPolicyEvaluator.evaluatePolicyItems(" + request
+ ", " + result + ", " + isResourceMatch + ")");
         }
 
-		RangerPerfTracer perf = null;
-
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.evaluatePolicyItems(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + "," + perfTag + ")");
-		}
-
         RangerPolicyItemEvaluator matchedPolicyItem = getMatchingPolicyItem(request, denyEvaluators,
denyExceptionEvaluators);
 
         if(matchedPolicyItem == null && !result.getIsAllowed()) { // if not denied,
evaluate allowItems only if not already allowed
@@ -230,8 +226,6 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
             }
         }
 
-		RangerPerfTracer.log(perf);
-
         if(LOG.isDebugEnabled()) {
             LOG.debug("<== RangerDefaultPolicyEvaluator.evaluatePolicyItems(" + request
+ ", " + result + ", " + isResourceMatch + ")");
         }
@@ -271,8 +265,8 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.isMatch(resource="
+ resource.getAsString() + "," + perfTag + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_REQUEST_LOG, "RangerPolicyEvaluator.isMatch(resource="
+ resource.getAsString() + "," + perfTag + ")");
 		}
 
 		if(resourceMatcher != null) {
@@ -383,8 +377,8 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.isAccessAllowed(hashCode="
+ Integer.toHexString(System.identityHashCode(this)) + "," + perfTag + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_REQUEST_LOG, "RangerPolicyEvaluator.isAccessAllowed(hashCode="
+ Integer.toHexString(System.identityHashCode(this)) + "," + perfTag + ")");
 		}
 
 		RangerPolicyItemEvaluator item = this.getDeterminingPolicyItem(user, userGroups, accessType);
@@ -547,12 +541,6 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
 
         RangerPolicyItemEvaluator ret = null;
 
-		RangerPerfTracer perf = null;
-
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerDefaultPolicyEvaluator.getMatchingPolicyItem(requestHashCode="
+ Integer.toHexString(System.identityHashCode(request)) + "," + perfTag + ")");
-		}
-
         if(CollectionUtils.isNotEmpty(evaluators)) {
             for (RangerPolicyItemEvaluator evaluator : evaluators) {
                 if(evaluator.isMatch(request)) {
@@ -577,8 +565,6 @@ public class RangerDefaultPolicyEvaluator extends RangerAbstractPolicyEvaluator
             }
         }
 
-		RangerPerfTracer.log(perf);
-
         if(LOG.isDebugEnabled()) {
             LOG.debug("<== RangerDefaultPolicyEvaluator.getMatchingPolicyItem(" + request
+ "): " + ret);
         }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyItemEvaluator.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyItemEvaluator.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyItemEvaluator.java
index 7f40bda..e2c715f 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyItemEvaluator.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerDefaultPolicyItemEvaluator.java
@@ -42,10 +42,11 @@ import org.apache.ranger.plugin.util.RangerPerfTracer;
 
 public class RangerDefaultPolicyItemEvaluator extends RangerAbstractPolicyItemEvaluator {
 	private static final Log LOG = LogFactory.getLog(RangerDefaultPolicyItemEvaluator.class);
-	private static final Log PERF_POLICY_LOG = RangerPerfTracer.getPerfLogger("policy");
-	private static final Log PERF_ITEM_LOG = RangerPerfTracer.getPerfLogger("item");
-	private static final Log PERF_CONDITION_LOG = RangerPerfTracer.getPerfLogger("condition");
 
+	private static final Log PERF_POLICYITEM_INIT_LOG = RangerPerfTracer.getPerfLogger("policyitem.init");
+	private static final Log PERF_POLICYITEM_REQUEST_LOG = RangerPerfTracer.getPerfLogger("policyitem.request");
+	private static final Log PERF_POLICYCONDITION_INIT_LOG = RangerPerfTracer.getPerfLogger("policycondition.init");
+	private static final Log PERF_POLICYCONDITION_REQUEST_LOG = RangerPerfTracer.getPerfLogger("policycondition.request");
 
 	public RangerDefaultPolicyItemEvaluator(RangerServiceDef serviceDef, RangerPolicy policy,
RangerPolicyItem policyItem, int policyItemType, int policyItemIndex, RangerPolicyEngineOptions
options) {
 		super(serviceDef, policy, policyItem, policyItemType, policyItemIndex, options);
@@ -61,8 +62,8 @@ public class RangerDefaultPolicyItemEvaluator extends RangerAbstractPolicyItemEv
 
 			RangerPerfTracer perf = null;
 
-			if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICY_LOG)) {
-				perf = RangerPerfTracer.getPerfTracer(PERF_POLICY_LOG, "RangerDefaultPolicyItemEvaluator.init(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ")");
+			if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYITEM_INIT_LOG)) {
+				perf = RangerPerfTracer.getPerfTracer(PERF_POLICYITEM_INIT_LOG, "RangerPolicyItemEvaluator.init(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ")");
 			}
 
 			for (RangerPolicyItemCondition condition : policyItem.getConditions()) {
@@ -80,8 +81,17 @@ public class RangerDefaultPolicyItemEvaluator extends RangerAbstractPolicyItemEv
 					conditionEvaluator.setServiceDef(serviceDef);
 					conditionEvaluator.setConditionDef(conditionDef);
 					conditionEvaluator.setPolicyItemCondition(condition);
+
+					RangerPerfTracer perfConditionInit = null;
+
+					if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYCONDITION_INIT_LOG)) {
+						perfConditionInit = RangerPerfTracer.getPerfTracer(PERF_POLICYCONDITION_INIT_LOG, "RangerConditionEvaluator.init(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ",policyConditionType=" + condition.getType()
+ ")");
+					}
+
 					conditionEvaluator.init();
 
+					RangerPerfTracer.log(perfConditionInit);
+
 					conditionEvaluators.add(conditionEvaluator);
 				} else {
 					LOG.error("RangerDefaultPolicyItemEvaluator(policyId=" + policyId + "): failed to instantiate
condition evaluator '" + condition.getType() + "'; evaluatorClassName='" + conditionDef.getEvaluator()
+ "'");
@@ -102,13 +112,13 @@ public class RangerDefaultPolicyItemEvaluator extends RangerAbstractPolicyItemEv
 		}
 
 		boolean ret = false;
+
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_ITEM_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_ITEM_LOG, "RangerDefaultPolicyItemEvaluator.isMatch(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYITEM_REQUEST_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYITEM_REQUEST_LOG, "RangerPolicyItemEvaluator.isMatch(resource="
+ request.getResource().getAsString()  + ")");
 		}
 
-
 		if(policyItem != null) {
 			if(matchUserGroup(request.getUser(), request.getUserGroups())) {
 				if (request.isAccessTypeDelegatedAdmin()) { // used only in grant/revoke scenario
@@ -239,13 +249,14 @@ public class RangerDefaultPolicyItemEvaluator extends RangerAbstractPolicyItemEv
 				}
 				RangerPerfTracer perf = null;
 
-				if(RangerPerfTracer.isPerfTraceEnabled(PERF_CONDITION_LOG)) {
+				if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYCONDITION_REQUEST_LOG)) {
+
 					String conditionType = null;
 					if (conditionEvaluator instanceof RangerAbstractConditionEvaluator) {
 						conditionType = ((RangerAbstractConditionEvaluator)conditionEvaluator).getPolicyItemCondition().getType();
 					}
 
-					perf = RangerPerfTracer.getPerfTracer(PERF_CONDITION_LOG, "RangerDefaultPolicyItemEvaluator.matchCustomConditions(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ",policyConditionType=" + conditionType
+ ")");
+					perf = RangerPerfTracer.getPerfTracer(PERF_POLICYCONDITION_REQUEST_LOG, "RangerConditionEvaluator.matchCondition(policyId="
+ policyId + ",policyItemIndex=" + getPolicyItemIndex() + ",policyConditionType=" + conditionType
+ ")");
 				}
 
 				boolean conditionEvalResult = conditionEvaluator.isMatched(request);

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
index 47dcd54..3e64faa 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/policyevaluator/RangerOptimizedPolicyEvaluator.java
@@ -28,14 +28,12 @@ import org.apache.ranger.plugin.model.RangerServiceDef;
 import org.apache.ranger.plugin.policyengine.RangerAccessRequest;
 import org.apache.ranger.plugin.policyengine.RangerPolicyEngine;
 import org.apache.ranger.plugin.policyengine.RangerPolicyEngineOptions;
-import org.apache.ranger.plugin.util.RangerPerfTracer;
 
 import java.util.*;
 import java.lang.Math;
 
 public class RangerOptimizedPolicyEvaluator extends RangerDefaultPolicyEvaluator {
     private static final Log LOG = LogFactory.getLog(RangerOptimizedPolicyEvaluator.class);
-    private static final Log PERF_LOG = RangerPerfTracer.getPerfLogger("policy");
 
     private Set<String> groups         = new HashSet<String>();
     private Set<String> users          = new HashSet<String>();
@@ -71,12 +69,6 @@ public class RangerOptimizedPolicyEvaluator extends RangerDefaultPolicyEvaluator
             LOG.debug("==> RangerOptimizedPolicyEvaluator.init()");
         }
 
-        RangerPerfTracer perf = null;
-
-        if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-            perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerOptimizedPolicyEvaluator.init(policyId="
+ policy.getId() + ",policyName=" + policy.getName() + ")");
-        }
-
         super.init(policy, serviceDef, options);
 
         preprocessPolicyItems(policy.getPolicyItems());
@@ -94,8 +86,6 @@ public class RangerOptimizedPolicyEvaluator extends RangerDefaultPolicyEvaluator
 
         setEvalOrder(computeEvalOrder());
 
-        RangerPerfTracer.log(perf);
-
         if(LOG.isDebugEnabled()) {
             LOG.debug("<== RangerOptimizedPolicyEvaluator.init()");
         }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
b/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
index 58d99bb..27968eb 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/util/PolicyRefresher.java
@@ -37,7 +37,8 @@ import com.google.gson.GsonBuilder;
 
 public class PolicyRefresher extends Thread {
 	private static final Log LOG = LogFactory.getLog(PolicyRefresher.class);
-	private static final Log PERF_LOG = RangerPerfTracer.getPerfLogger("policy");
+
+	private static final Log PERF_POLICYENGINE_INIT_LOG = RangerPerfTracer.getPerfLogger("policyengine.init");
 
 	private final RangerBasePlugin  plugIn;
 	private final String            serviceType;
@@ -174,8 +175,8 @@ public class PolicyRefresher extends Thread {
 
 		RangerPerfTracer perf = null;
 
-		if(RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-			perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "PolicyRefresher.loadPolicy(serviceName="
+ serviceName + ")");
+		if(RangerPerfTracer.isPerfTraceEnabled(PERF_POLICYENGINE_INIT_LOG)) {
+			perf = RangerPerfTracer.getPerfTracer(PERF_POLICYENGINE_INIT_LOG, "PolicyRefresher.loadPolicy(serviceName="
+ serviceName + ")");
 		}
 
 		//load policy from PolicyAdmin

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerPerfTracer.java
----------------------------------------------------------------------
diff --git a/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerPerfTracer.java
b/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerPerfTracer.java
index 175c4e4..e130cc7 100644
--- a/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerPerfTracer.java
+++ b/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerPerfTracer.java
@@ -29,10 +29,12 @@ public class RangerPerfTracer {
 	protected final String data;
 	private final long   startTimeMs;
 
+	private static long reportingThresholdMs = 0L;
+
 	private final static String tagEndMarker = "(";
 
 	public static Log getPerfLogger(String name) {
-		return LogFactory.getLog("ranger.perf." + name);
+		return LogFactory.getLog("org.apache.ranger.perf." + name);
 	}
 
 	public static Log getPerfLogger(Class<?> cls) {
@@ -89,8 +91,9 @@ public class RangerPerfTracer {
 	}
 
 	public void log() {
-		if(logger.isDebugEnabled()) {
-			logger.debug("[PERF] " + tag + data + ": " + getElapsedTime());
+		long elapsedTime = getElapsedTime();
+		if (elapsedTime > reportingThresholdMs) {
+			logger.debug("[PERF] " + tag + data + ": " + elapsedTime);
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/agents-common/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/agents-common/src/test/resources/log4j.xml b/agents-common/src/test/resources/log4j.xml
index 48ed214..1f2f78c 100644
--- a/agents-common/src/test/resources/log4j.xml
+++ b/agents-common/src/test/resources/log4j.xml
@@ -10,8 +10,8 @@
     </appender>
 
     <!--
-    <appender name="perf_appender" class="org.apache.log4j.DailyRollingFileAppender">
-        <param name="file" value="./ranger_admin_perf_test.log" />
+    <appender name="ranger_perf_appender" class="org.apache.log4j.DailyRollingFileAppender">
+        <param name="file" value="./ranger_admin_perf.log" />
         <param name="datePattern" value="'.'yyyy-MM-dd" />
         <param name="append" value="true" />
         <layout class="org.apache.log4j.PatternLayout">
@@ -19,34 +19,39 @@
         </layout>
     </appender>
 
-    <category name="ranger.perf" additivity="false">
-        <priority value="info" />
-        <appender-ref ref="perf_appender" />
-    </category>
-
-    <category name="ranger.perf.policy" additivity="false">
-        <priority value="warn" />
-        <appender-ref ref="perf_appender" />
-    </category>
-
-    <category name="ranger.perf.item" additivity="false">
-        <priority value="warn" />
-        <appender-ref ref="perf_appender" />
-    </category>
-
-    <category name="ranger.perf.condition" additivity="false">
-        <priority value="warn" />
-        <appender-ref ref="perf_appender" />
-    </category>
-
-    <category name="ranger.perf.enricher" additivity="false">
-        <priority value="warn" />
-        <appender-ref ref="perf_appender" />
-    </category>
+    <logger name="org.apache.ranger.perf.policyengine" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
+
+    <logger name="org.apache.ranger.perf.policy" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
+
+    <logger name="org.apache.ranger.perf.policyitem" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
+
+    <logger name="org.apache.ranger.perf.contextenricher" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
+
+    <logger name="org.apache.ranger.perf.policycondition" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
+
+    <logger name="org.apache.ranger.perf.db" additivity="false">
+        <level value="debug" />
+        <appender-ref ref="ranger_perf_appender" />
+    </logger>
     -->
 
     <root>
-        <priority value="warn" />
+        <level value="warn" />
         <appender-ref ref="console" />
     </root>
 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/ranger-tools/conf/log4j.properties
----------------------------------------------------------------------
diff --git a/ranger-tools/conf/log4j.properties b/ranger-tools/conf/log4j.properties
index ccb9db4..86f5c18 100644
--- a/ranger-tools/conf/log4j.properties
+++ b/ranger-tools/conf/log4j.properties
@@ -40,8 +40,8 @@ log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}:
%L
 ranger.perf.logger=DEBUG,PERF
 ranger.perf.log.file=ranger-perf-test.log
 
-log4j.logger.ranger.perf=${ranger.perf.logger}
-log4j.additivity.ranger.perf=false
+log4j.logger.org.apache.ranger.perf=${ranger.perf.logger}
+log4j.additivity.org.apache.ranger.perf=false
 
 log4j.appender.PERF=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.PERF.File=${ranger.perf.log.file}

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/ranger-tools/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/ranger-tools/src/test/resources/log4j.properties b/ranger-tools/src/test/resources/log4j.properties
index abf617e..4ea9d85 100644
--- a/ranger-tools/src/test/resources/log4j.properties
+++ b/ranger-tools/src/test/resources/log4j.properties
@@ -40,8 +40,8 @@ log4j.appender.console.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2}:
%L
 ranger.perf.logger=DEBUG,PERF
 ranger.perf.log.file=${java.io.tmpdir}/ranger-perf-test.log
 
-log4j.logger.ranger.perf=${ranger.perf.logger}
-log4j.additivity.ranger.perf=false
+log4j.logger.org.apache.ranger.perf=${ranger.perf.logger}
+log4j.additivity.org.apache.ranger.perf=false
 
 log4j.appender.PERF=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.PERF.File=${ranger.perf.log.file}

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/ranger-tools/testdata/test_modules.txt
----------------------------------------------------------------------
diff --git a/ranger-tools/testdata/test_modules.txt b/ranger-tools/testdata/test_modules.txt
index 03771fa..9ffcbfc 100644
--- a/ranger-tools/testdata/test_modules.txt
+++ b/ranger-tools/testdata/test_modules.txt
@@ -17,7 +17,20 @@
 # under the License.
 #
 
-RangerTagEnricher.setServiceTags
+PolicyRefresher.loadPolicy
 RangerPolicyEngine.init
-RangerPolicyEngine.preProcess
-RangerPolicyEngine.isAccessAllowedNoAudit
+RangerContextEnricher.init
+RangerPolicyEvaluator.init
+RangerPolicyItemEvaluator.init
+RangerConditionEvaluator.init
+RangerContextEnricher.enrich
+RangerPolicyEngine.isAccessAllowed
+RangerPolicyEvaluator.evaluate
+RangerPolicyEvaluator.isMatch
+RangerPolicyItemEvaluator.isMatch
+RangerConditionEvaluator.matchCondition
+RangerPolicyEngine.processAudit
+RangerTagRefresher.populateTags
+RangerPolicyEvaluator.isAccessAllowed
+RangerPolicyRetriever.getServicePolicies
+RangerTagDBReceiver.getTags

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/f79bc59a/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
b/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
index 6cc4e5e..bbdf181 100644
--- a/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
+++ b/security-admin/src/main/java/org/apache/ranger/biz/RangerTagDBRetriever.java
@@ -61,7 +61,7 @@ public class RangerTagDBRetriever {
 			RangerPerfTracer perf = null;
 
 			if (RangerPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
-				perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerTagDBReceiver-Optimized(serviceName="
+ xService.getName());
+				perf = RangerPerfTracer.getPerfTracer(PERF_LOG, "RangerTagDBReceiver.getTags(serviceName="
+ xService.getName());
 			}
 
 			TagRetrieverServiceResourceContext serviceResourceContext = new TagRetrieverServiceResourceContext(xService);



Mime
View raw message