2 * ============LICENSE_START=======================================================
3 * DCAEGEN2-SERVICES-SDK
4 * ================================================================================
5 * Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dcaegen2.services.sdk.rest.services.model.logging;
27 public final class MdcVariables {
30 public static final String X_ONAP_REQUEST_ID = "X-ONAP-RequestID";
32 public static final String X_INVOCATION_ID = "X-InvocationID";
34 public static final String INSTANCE_UUID = "InstanceUUID";
35 public static final String RESPONSE_CODE = "ResponseCode";
36 public static final String REQUEST_ID = "RequestID";
37 public static final String CLIENT_NAME = "PartnerName";
38 public static final String CLIENT_IP = "ClientIPAddress";
39 public static final String INVOCATION_ID = "InvocationID";
40 public static final String INVOCATION_TIMESTAMP = "InvokeTimestamp";
41 public static final String STATUS_CODE = "StatusCode";
42 public static final String INSTANCE_ID = "InstanceID";
43 public static final String SERVER_FQDN = "ServerFQDN";
44 public static final String SERVICE_NAME = "ServiceName";
46 private static final String HTTP_HEADER_PREFIX = "X-";
48 private MdcVariables() {
51 public static String httpHeader(String mdcName) {
52 return HTTP_HEADER_PREFIX + mdcName;
56 * @deprecated use {@link RequestDiagnosticContext#withSlf4jMdc(Runnable)}.
57 * @param mdcContextMap
60 public static void setMdcContextMap(Map<String, String> mdcContextMap) {
61 if (mdcContextMap != null) {
62 MDC.setContextMap(mdcContextMap);