From 8ed1d1c28fbf0e95e86f061f50bb362265ca51de Mon Sep 17 00:00:00 2001 From: Joseph Chou Date: Wed, 8 Apr 2020 17:45:38 -0400 Subject: Update common-logging for log enhancement work Resolve missing error code, add marker/mdc for audit/metrics Change-Id: I490b17aac86f3b63df43e267a5dbe1d1588e5fdf Issue-ID: POLICY-2478 Signed-off-by: Joseph Chou --- .../policy/common/logging/eelf/ErrorCodeMap.java | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java') diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java index fab0415b..32bb6fec 100644 --- a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java +++ b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-Logging * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,13 @@ import java.util.EnumMap; /** * ErrorCodeMap contains a HashMap of ErrorCodeInfo (error code and error description). + * Standard error code: + * 100 – permission errors + * 200 – availability errors + * 300 – data errors + * 400 – schema errors + * 500 – business process errors + * 900 – unknown errors */ public class ErrorCodeMap { @@ -31,41 +38,42 @@ public class ErrorCodeMap { private static final String CHECK_ERROR_MESSAGE = " Please check the error message for detail information"; - private static final String ERROR_PERMISSIONS = "POLICY-100E"; + private static final String ERROR_PERMISSIONS = "100"; private static final String ERROR_PERMISSIONS_DESCRIPTION = "This is a Permissions Error." + CHECK_ERROR_MESSAGE; - private static final String ERROR_SCHEMA_INVALID = "POLICY-400E"; + private static final String ERROR_SCHEMA_INVALID = "400"; private static final String ERROR_SCHEMA_INVALID_DESCRIPTION = "This is an Invalid Schema Error." + CHECK_ERROR_MESSAGE; - private static final String UPDATE_ERROR = "POLICY-502E"; + + private static final String UPDATE_ERROR = "300"; private static final String UPDATE_ERROR_DESCRIPTION = "This is an updating error." + CHECK_ERROR_MESSAGE; - private static final String EXCEPTION_ERROR_CODE = "POLICY-503E"; + private static final String EXCEPTION_ERROR_CODE = "500"; private static final String EXCEPTION_ERROR_DESCRIPTION = "This is an exception error message during the process." + CHECK_ERROR_MESSAGE; - private static final String MISS_PROPERTY_ERROR = "POLICY-504E"; + private static final String MISS_PROPERTY_ERROR = "300"; private static final String MISS_PROPERTY_ERROR_DESCRIPTION = "This is an error of missing properties." + CHECK_ERROR_MESSAGE; - private static final String GENERAL_ERROR_CODE = "POLICY-515E"; + private static final String GENERAL_ERROR_CODE = "500"; private static final String GENERAL_ERROR_DESCRIPTION = "This is a general error message during the process." + CHECK_ERROR_MESSAGE; - private static final String ERROR_SYSTEM_ERROR = "POLICY-516E"; + private static final String ERROR_SYSTEM_ERROR = "200"; private static final String ERROR_SYSTEM_ERROR_DESCRIPTION = "This is a System Error." + CHECK_ERROR_MESSAGE; - private static final String ERROR_DATA_ISSUE = "POLICY-517E"; + private static final String ERROR_DATA_ISSUE = "300"; private static final String ERROR_DATA_ISSUE_DESCRIPTION = "This is a Data Issue Error." + CHECK_ERROR_MESSAGE; - private static final String ERROR_PROCESS_FLOW = "POLICY-518E"; + private static final String ERROR_PROCESS_FLOW = "500"; private static final String ERROR_PROCESS_FLOW_DESCRIPTION = "This is a Process Flow Error." + CHECK_ERROR_MESSAGE; - private static final String ERROR_UNKNOWN = "POLICY-519E"; + private static final String ERROR_UNKNOWN = "900"; private static final String ERROR_UNKNOWN_DESCRIPTION = "This is an Unknown Error." + CHECK_ERROR_MESSAGE; - private static final String ERROR_AUDIT = "POLICY-520E"; + private static final String ERROR_AUDIT = "300"; private static final String ERROR_AUDIT_DESCRIPTION = "This is an audit Error." + CHECK_ERROR_MESSAGE; static { -- cgit 1.2.3-korg