2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T 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.openecomp.sdc.common.log.elements;
23 import org.openecomp.sdc.common.log.api.ILogConfiguration;
24 import org.openecomp.sdc.common.log.api.ILogFieldsHandler;
25 import org.openecomp.sdc.common.log.enums.LogLevel;
26 import org.openecomp.sdc.common.log.enums.LogMarkers;
27 import org.slf4j.Logger;
28 import org.slf4j.MarkerFactory;
30 import java.util.ArrayList;
31 import java.util.Arrays;
32 import java.util.List;
34 public class LoggerDebug extends LoggerBase {
36 private static ArrayList<String> mandatoryFields = new ArrayList<>(Arrays.asList(ILogConfiguration.MDC_KEY_REQUEST_ID));
38 LoggerDebug(ILogFieldsHandler ecompMdcWrapper, Logger logger) {
39 super(ecompMdcWrapper, MarkerFactory.getMarker(LogMarkers.DEBUG_MARKER.text()), logger);
43 public LoggerDebug clear() {
49 public void log(LogLevel logLevel, String message, Object... params) {
50 setKeyRequestIdIfNotSetYet();
51 super.log(logLevel, message, params);
55 public void log(LogLevel logLevel, String message, Throwable throwable) {
56 setKeyRequestIdIfNotSetYet();
57 super.log(logLevel, message, throwable);
61 public void log(LogLevel logLevel, String message) {
62 setKeyRequestIdIfNotSetYet();
63 super.log(logLevel, message);
67 public LoggerDebug startTimer() {
72 public List<String> getMandatoryFields() {
73 return mandatoryFields;