import org.onap.dcae.analytics.model.AnalyticsHttpConstants;
import org.onap.dcae.analytics.model.DmaapMrConstants;
+import org.onap.dcae.analytics.tca.core.util.LogSpec;
import org.onap.dcae.analytics.web.util.AnalyticsHttpUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLogFactory;
+import org.onap.dcae.utils.eelf.logger.api.log.EELFLogger;
+import org.onap.dcae.utils.eelf.logger.api.spec.DebugLogSpec;
import org.springframework.http.HttpStatus;
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
import org.springframework.integration.support.MessageBuilder;
*/
public class MrSubscriberPollingAdvice extends AbstractRequestHandlerAdvice {
- private static final Logger log = LoggerFactory.getLogger(MrSubscriberPollingAdvice.class);
+ private static final EELFLogger eelfLogger = EELFLogFactory.getLogger(MrSubscriberPollingAdvice.class);
private final DynamicPeriodicTrigger trigger;
private final int minPollingInterval;
final String requestId = AnalyticsHttpUtils.getRequestId(message.getHeaders());
final String transactionId = AnalyticsHttpUtils.getTransactionId(message.getHeaders());
-
- log.debug("Request Id: {}, Transaction Id: {}, Messages Present: {}, " +
- "Next Polling Interval will be: {}", requestId, transactionId,
- areMessagesPresent, nextPollingInterval);
+ final DebugLogSpec debugLogSpec = LogSpec.createDebugLogSpec(requestId);
+ eelfLogger.debugLog().debug("Request Id: {}, Transaction Id: {}, Messages Present: {}, " +
+ "Next Polling Interval will be: {}", debugLogSpec, requestId, transactionId,
+ String.valueOf(areMessagesPresent), nextPollingInterval.toString());
trigger.setPeriod(nextPollingInterval.get());
// if no messages were found in dmaap poll - terminate further processing
if (!areMessagesPresent) {
- log.info("Request Id: {}, Transaction Id: {}, No new messages found in DMaaP MR Response. " +
- "No further processing required", requestId, transactionId);
+ eelfLogger.debugLog().debug("Request Id: {}, Transaction Id: {}, No new messages found in DMaaP MR Response. " +
+ "No further processing required", debugLogSpec, requestId, transactionId);
return null;
}