ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pengjian...@apache.org
Subject ranger git commit: RANGER-1816:When the error occurs, the system does not record the error message
Date Tue, 10 Oct 2017 01:11:46 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 23046e9e8 -> de417e185


RANGER-1816:When the error occurs, the system does not record the error message

Signed-off-by: peng.jianhua <peng.jianhua@zte.com.cn>


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

Branch: refs/heads/master
Commit: de417e1851603e98c2acb0e6a81b0f2524256a06
Parents: 23046e9
Author: zhangqiang2 <zhangqiang2@zte.com.cn>
Authored: Mon Oct 9 10:46:02 2017 +0800
Committer: peng.jianhua <peng.jianhua@zte.com.cn>
Committed: Tue Oct 10 09:10:45 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/ranger/service/RangerPolicyService.java | 9 ++++++---
 .../main/java/org/apache/ranger/service/XGroupService.java  | 8 ++++----
 .../main/java/org/apache/ranger/service/XUserService.java   | 8 ++++----
 3 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/de417e18/security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java
b/security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java
index f55a103..5aec948 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/RangerPolicyService.java
@@ -24,6 +24,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.ranger.entity.XXDataMaskTypeDef;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.ranger.biz.RangerPolicyRetriever;
@@ -50,6 +52,7 @@ import org.springframework.stereotype.Service;
 @Service
 @Scope("singleton")
 public class RangerPolicyService extends RangerPolicyServiceBase<XXPolicy, RangerPolicy>
{
+	private static final Log logger = LogFactory.getLog(RangerPolicyService.class);
 
 	@Autowired
 	JSONUtil jsonUtil;
@@ -165,9 +168,9 @@ public class RangerPolicyService extends RangerPolicyServiceBase<XXPolicy,
Range
 				}
 			}
 		} catch (IllegalAccessException illegalAcc) {
-			illegalAcc.printStackTrace();
+			logger.error("Transaction log failure.", illegalAcc);
 		} catch (NoSuchFieldException noSuchField) {
-			noSuchField.printStackTrace();
+			logger.error("Transaction log failure.", noSuchField);
 		}
 		
 		return trxLogList;
@@ -391,7 +394,7 @@ public class RangerPolicyService extends RangerPolicyServiceBase<XXPolicy,
Range
 				xTrxLog.setNewValue(value);
 			}
 		} catch (IllegalArgumentException | IllegalAccessException e) {
-			e.printStackTrace();
+			logger.error("Process field to create trx log failure.", e);
 		}
 
 		xTrxLog.setAction(actionString);

http://git-wip-us.apache.org/repos/asf/ranger/blob/de417e18/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java b/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
index fd57430..ddcd287 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/XGroupService.java
@@ -222,13 +222,13 @@ public class XGroupService extends XGroupServiceBase<XXGroup, VXGroup>
{
 				
 			}
 		} catch (IllegalArgumentException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (IllegalAccessException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (SecurityException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		}
 		
 		return trxLogList;

http://git-wip-us.apache.org/repos/asf/ranger/blob/de417e18/security-admin/src/main/java/org/apache/ranger/service/XUserService.java
----------------------------------------------------------------------
diff --git a/security-admin/src/main/java/org/apache/ranger/service/XUserService.java b/security-admin/src/main/java/org/apache/ranger/service/XUserService.java
index 9be833c..fbc37d6 100644
--- a/security-admin/src/main/java/org/apache/ranger/service/XUserService.java
+++ b/security-admin/src/main/java/org/apache/ranger/service/XUserService.java
@@ -374,13 +374,13 @@ public class XUserService extends XUserServiceBase<XXUser, VXUser>
{
 			}
 
 		} catch (IllegalArgumentException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (IllegalAccessException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		} catch (SecurityException e) {
-			e.printStackTrace();
+			logger.error("Transaction log failure.", e);
 		}
 
 		return trxLogList;


Mime
View raw message